settings: use exec() to load local settings
authorFrédéric Péters <fpeters@0d.be>
Sat, 4 Apr 2020 14:06:53 +0000 (16:06 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sat, 4 Apr 2020 14:06:53 +0000 (16:06 +0200)
panikdb/settings.py

index 13bd9bf..b237a57 100644 (file)
@@ -269,10 +269,13 @@ HAS_SOMA = False
 SITE_TITLE = 'PanikDB'
 COMBO_CELL_ASSET_SLOTS = {}
 
-try:
-    from .local_settings import *
-except ImportError:
-    pass
+local_settings_file = os.environ.get(
+    'PANIKDB_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())
+
+
 
 if DEBUG and DEBUG_TOOLBAR:
     MIDDLEWARE_CLASSES += (