diff --git a/requirements.txt b/requirements.txt index 4657a31..5c6497c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ django==3.0.5 django-debug-toolbar==2.2 whitenoise==5.0.1 brotli==1.0.7 +django-environ==0.4.5 diff --git a/website/settings.py b/website/settings.py index 6fc5a0c..909c1e8 100644 --- a/website/settings.py +++ b/website/settings.py @@ -12,6 +12,10 @@ https://docs.djangoproject.com/en/3.0/ref/settings/ import os +import environ + +env = environ.Env(DEBUG=(bool, False)) + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -23,7 +27,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = "gd(%^4!762m4y*c56t(ppm&-5+*a*6-&5)n%nc^aqfi%54^u_j" # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = env("DEBUG") ALLOWED_HOSTS = "*"