Moved DEBUG variable to config

This commit is contained in:
MartenBE
2020-08-09 23:52:32 +02:00
parent a6baddf611
commit 88d0295ae1
5 changed files with 6 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ class Config:
self.db_user = _data["USER"]
self.db_pass = _data["PASSWORD"]
self.SECRET = _data["SECRET"]
self.debug_build_mode = (_data["SECRET"].casefold() == "debug")
def open_file(self, _cp):
"""

View File

@@ -32,8 +32,9 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = CONFIG.SECRET
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = TEMPLATE_DEBUG = False
DEBUG = TEMPLATE_DEBUG = CONFIG.debug_build_mode
if DEBUG is True:
print("DEBUG build mode is ON")
from pudb.remote import set_trace
ALLOWED_HOSTS = CONFIG.allowed_hosts