From cce3682b72d56867c068abaadded6601e22b43d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 4 Apr 2020 16:06:32 +0200 Subject: [PATCH] settings: use exec() to load local settings --- panikweb/settings.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/panikweb/settings.py b/panikweb/settings.py index 5173478..66c43c0 100644 --- a/panikweb/settings.py +++ b/panikweb/settings.py @@ -252,10 +252,11 @@ WEBSITE_BASE_URL = 'http://www.radiopanik.org/' COMBO_INITIAL_LOGIN_PAGE_PATH = '/' COMBO_WELCOME_PAGE_PATH = None -try: - from .local_settings import * -except ImportError as e: - pass +local_settings_file = os.environ.get( + 'PANIKWEB_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 += ( -- 2.39.2