Skip to content
Snippets Groups Projects
Unverified Commit b9148197 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Use django-local-settings for configuration.

parent 17bd3358
No related branches found
No related tags found
No related merge requests found
import os import os
from local_settings import load_and_check_settings, LocalSetting, SecretSetting
from .util import get_app_packages from .util import get_app_packages
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # 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 = LocalSetting(default=os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'wvo@&^9@yi4(eahof$i2v3j#$=%lkw=%8=h2_eo6n5w!y9a*%u' SECRET_KEY = SecretSetting(default='wvo@&^9@yi4(eahof$i2v3j#$=%lkw=%8=h2_eo6n5w!y9a*%u')
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = LocalSetting(default=False)
ALLOWED_HOSTS = [] ALLOWED_HOSTS = LocalSetting(default=[])
# Application definition # Application definition
...@@ -96,9 +98,9 @@ AUTH_PASSWORD_VALIDATORS = [ ...@@ -96,9 +98,9 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/ # https://docs.djangoproject.com/en/2.1/topics/i18n/
LANGUAGE_CODE = 'de-de' LANGUAGE_CODE = LocalSetting(default='de-de')
TIME_ZONE = 'Europe/Berlin' TIME_ZONE = LocalSetting(default='Europe/Berlin')
USE_I18N = True USE_I18N = True
...@@ -118,3 +120,9 @@ MENU_SELECT_PARENTS = True ...@@ -118,3 +120,9 @@ MENU_SELECT_PARENTS = True
LOGIN_REDIRECT_URL = 'index' LOGIN_REDIRECT_URL = 'index'
LOGOUT_REDIRECT_URL = 'index' LOGOUT_REDIRECT_URL = 'index'
STATIC_ROOT = LocalSetting()
MEDIA_ROOT = LocalSetting()
_settings = load_and_check_settings(globals())
globals().update(_settings)
...@@ -19,6 +19,7 @@ setup( ...@@ -19,6 +19,7 @@ setup(
'Django >= 2.0', 'Django >= 2.0',
'django-bootstrap3', 'django-bootstrap3',
'django-easy-audit', 'django-easy-audit',
'django-local-settings',
'django-simple-menu', 'django-simple-menu',
], ],
classifiers=[ classifiers=[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment