Commit 1d528f32 authored by Jamesie Pic's avatar Jamesie Pic
Browse files

Restore basic environment variable settings

parent 0a22f9a0
Pipeline #225 passed with stages
in 7 minutes and 34 seconds
......@@ -21,7 +21,10 @@ from django.utils.crypto import get_random_string
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = os.environ.get('DJANGO_DEBUG', 'false').lower() == 'true'
DEBUG = os.getenv('DJANGO_DEBUG', False)
if hasattr(DEBUG, 'lower') and DEBUG.lower() in ('false', '0', 'none'):
DEBUG = False # Support none-ish values
# Main Django config
......@@ -226,11 +229,11 @@ PUBLIC_DIR = 'wsgi/static'
'default': {
'NAME': 'memopol',
'USER': 'memopol',
'PASSWORD': 'memopol',
'HOST': 'localhost',
'PORT': '5432',
'NAME': os.getenv('DB_NAME', 'memopol'),
  • Why not use local_settings to do that ? Plus those should be prefixed. Env variables are global, so we at least need minimal namespacing.

Please register or sign in to reply
'USER': os.getenv('DB_USER', 'memopol'),
'PASSWORD': os.getenv('DB_PASSWORD', 'memopol'),
'HOST': os.getenv('DB_HOST', 'localhost'),
'PORT': os.getenv('DB_PORT', '5432'),
'ENGINE': 'django.db.backends.postgresql_psycopg2',
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment