diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index 19d857b5..2d645844 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -13,7 +13,19 @@ BASE_DIR = PACKAGE_ROOT ### USER SETTINGS -DEBUG = True +DEBUG = os.environ.get('SYMPOSION_APP_DEBUG', '0') +if isinstance(DEBUG, str): + try: + i = int(DEBUG) + if not i in [0, 1]: + raise ValueError("not 0 or 1") + DEBUG = bool(i) + except ValueError: + sys.exit('DEBUG env var must be set to string value of a 0 or 1') +else: + sys.exit('DEBUG env var is in unexpected format. Should be a string' + 'containing either a 0 or a 1 - Got type %s' % type(DEBUG)) + DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3",