]> git.0d.be Git - panikdb.git/commitdiff
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 13bd9bf73310719a8eef15ca66275bb46e9cb6b4..b237a5791816dca55a496b3a09674b323e2d962f 100644 (file)
@@ -269,10 +269,13 @@ HAS_SOMA = False
 SITE_TITLE = 'PanikDB'
 COMBO_CELL_ASSET_SLOTS = {}
 
 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 += (
 
 if DEBUG and DEBUG_TOOLBAR:
     MIDDLEWARE_CLASSES += (