Skip to content

Commit 98296b7

Browse files
author
Gabriel Monroy
committed
add dynamic confd settings lookup (with local_settings override)
1 parent f5312c5 commit 98296b7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

deis/settings.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from __future__ import unicode_literals
66
import os.path
7+
import sys
78
import tempfile
89

910
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
@@ -305,6 +306,14 @@
305306
# see https://docs.djangoproject.com/en/1.5/ref/settings/#std:setting-ALLOWED_HOSTS
306307
ALLOWED_HOSTS = ['*']
307308

309+
# import dynamic confd settings from /app, if they exist
310+
try:
311+
if os.path.exists('/app/confd_settings.py'):
312+
sys.path.append('/app')
313+
from confd_settings import *
314+
except ImportError:
315+
pass
316+
308317
# Create a file named "local_settings.py" to contain sensitive settings data
309318
# such as database configuration, admin email, or passwords and keys. It
310319
# should also be used for any settings which differ between development

0 commit comments

Comments
 (0)