settings: add support for local settings file
authorFrédéric Péters <fpeters@0d.be>
Sun, 29 Dec 2019 12:50:21 +0000 (13:50 +0100)
committerFrédéric Péters <fpeters@0d.be>
Sun, 29 Dec 2019 13:34:25 +0000 (14:34 +0100)
.gitignore [new file with mode: 0644]
chloro/settings.py

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..b629017
--- /dev/null
@@ -0,0 +1 @@
+/chloro/local_settings.py
index e18c021402b63b25bbe41724d63bdf10fad78d48..3fb408aa21aa0d31db7a38262112893cb3e05261 100644 (file)
@@ -106,3 +106,9 @@ USE_TZ = True
 # https://docs.djangoproject.com/en/1.11/howto/static-files/
 
 STATIC_URL = '/static/'
+
+local_settings_file = os.environ.get(
+    'CHLORO_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')
+)
+if os.path.exists(local_settings_file):
+    exec(open(local_settings_file).read())