Reorganized settings

ability to override with localsettings
This commit is contained in:
2020-05-05 14:28:52 +02:00
parent 7daff47d5c
commit 1ee58f1b66
3 changed files with 20 additions and 2 deletions

View File

@@ -0,0 +1,4 @@
try:
from .localsettings import *
except ImportError:
from .defaultsettings import *

View File

@@ -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

View 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',
}