From 80a91594dabbfa5135a05096ffdce5d7bc87744a Mon Sep 17 00:00:00 2001 From: erichhasl Date: Sun, 19 Nov 2017 16:41:44 +0100 Subject: [PATCH] load debug var from environment --- web_dev/sas_web/sas_web/settings.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web_dev/sas_web/sas_web/settings.py b/web_dev/sas_web/sas_web/settings.py index 9573805..93a12aa 100644 --- a/web_dev/sas_web/sas_web/settings.py +++ b/web_dev/sas_web/sas_web/settings.py @@ -24,7 +24,11 @@ SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'dnwe1fairy&@7=qoe7(w0bahnt9(&%zn8bph5&-r$1*s2$d2@h') # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +debug = os.environ.get('DJANGO_DEBUG', None) +if debug: + DEBUG = False if debug == '0' else True +else: + DEBUG = True allowed = os.environ.get('DJANGO_ALLOWED_HOST', None) if allowed is not None: