use environ for environment variables
This commit is contained in:
@@ -11,6 +11,11 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import environ
|
||||||
|
env = environ.Env(
|
||||||
|
# set casting, default value
|
||||||
|
DEBUG=(bool, True)
|
||||||
|
)
|
||||||
|
|
||||||
# Prints and logs are written to console
|
# Prints and logs are written to console
|
||||||
# TODO: Change before release
|
# TODO: Change before release
|
||||||
@@ -37,13 +42,15 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
|
||||||
|
|
||||||
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
|
DEBUG = env('DEBUG')
|
||||||
|
if DEBUG:
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = 'r37-i7l)vrduzz2-gira+z#u!p!di9#f+%s*5-bb($hg)55@ns'
|
SECRET_KEY = 'r37-i7l)vrduzz2-gira+z#u!p!di9#f+%s*5-bb($hg)55@ns'
|
||||||
|
else:
|
||||||
|
SECRET_KEY = env('SECRET_KEY')
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
ALLOWED_HOSTS = ["127.0.0.1", "localhost"]
|
||||||
DEBUG = True
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = []
|
|
||||||
|
|
||||||
DATA_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 * 1024
|
DATA_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 * 1024
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ docutils==0.16
|
|||||||
easy-thumbnails==2.7.0
|
easy-thumbnails==2.7.0
|
||||||
etherpad-lite==0.5
|
etherpad-lite==0.5
|
||||||
django-filter
|
django-filter
|
||||||
ldap3
|
ldap3django-environ
|
||||||
|
|||||||
Reference in New Issue
Block a user