-# -*- coding: utf-8 -*-
-from os import path
-
-PROJECT_ROOT = path.realpath(path.dirname(__file__))
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = []
-
-MANAGERS = ADMINS
-
-DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = PROJECT_ROOT + '/dev.sqlite' # Or path to database file if using sqlite3.
-DATABASE_USER = '' # Not used with sqlite3.
-DATABASE_PASSWORD = '' # Not used with sqlite3.
-DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
+import os
+
+PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
+
+ADMINS = [
+ tuple(adm.split(':'))
+ for adm in
+ os.environ.get('ADMINS', '').split('\n')
+ if adm
+]
+
+MANAGERS = [
+ tuple(adm.split(':'))
+ for adm in
+ os.environ.get('MANAGERS', os.environ.get('ADMINS', '')).split('\n')
+ if adm
+]
+
+DEBUG = False
+
+if 'DB_NAME' in os.environ:
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.postgresql_psycopg2',
+ 'NAME': os.environ['DB_NAME'],
+ 'USER': os.environ.get('DB_USER', ''),
+ 'PASSWORD': os.environ.get('DB_PASSWORD', ''),
+ 'HOST': os.environ.get('DB_HOST', ''),
+ 'PORT': os.environ.get('DB_PORT', ''),
+ }
+ }
+else:
+ DEBUG = True
+
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': '/app/src/cas/dev.sqlite',
+ }
+ }
+
+
+DEBUG = os.environ.get('DEBUG', str(DEBUG)).lower() == 'true'
+
+EMAIL_HOST = os.environ.get('EMAIL_HOST', 'localhost')
+DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', '')
+EMAIL_SUBJECT_PREFIX = os.environ.get('EMAIL_SUBJECT_PREFIX', '')
+SECRET_KEY = os.environ.get('SECRET_KEY', '')
+ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split()
+EMAILS_BASE_DOMAINS = os.environ.get('EMAILS_BASE_DOMAINS', '').split()
+SECURE_PROXY_SSL_HEADER = os.environ.get('SECURE_PROXY_SSL_HEADER', '').split()