Reorganized settings
ability to override with localsettings
This commit is contained in:
4
videodinges/settings/__init__.py
Normal file
4
videodinges/settings/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
try:
|
||||
from .localsettings import *
|
||||
except ImportError:
|
||||
from .defaultsettings import *
|
||||
@@ -13,7 +13,7 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
|
||||
import os
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
BASE_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..', '..'))
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
@@ -137,4 +137,3 @@ FILE_UPLOAD_HANDLERS = ['django.core.files.uploadhandler.TemporaryFileUploadHand
|
||||
FILE_UPLOAD_MAX_MEMORY_SIZE = 2147483648 # 2GB
|
||||
|
||||
FILE_UPLOAD_TEMP_DIR = os.path.join(BASE_DIR, 'tmp') # probably default /tmp is too small for video files
|
||||
|
||||
15
videodinges/settings/localsettings-example.py
Normal file
15
videodinges/settings/localsettings-example.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
Copy this file to localsettings.py to make local overrides.
|
||||
BEWARE to always import defaultsettings as well if activate this file.
|
||||
"""
|
||||
|
||||
from .defaultsettings import *
|
||||
|
||||
DATABASES['default'] = {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'videos', # database name
|
||||
'USER': 'videos',
|
||||
'PASSWORD': 'v3r7s3cr3t',
|
||||
'HOST': 'localhost',
|
||||
'PORT': '5432',
|
||||
}
|
||||
Reference in New Issue
Block a user