From 3df85d6d243fb614e26f67eebc12b9c43000fcf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 29 Dec 2019 13:50:21 +0100 Subject: [PATCH] settings: add support for local settings file --- .gitignore | 1 + chloro/settings.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b629017 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/chloro/local_settings.py diff --git a/chloro/settings.py b/chloro/settings.py index e18c021..3fb408a 100644 --- a/chloro/settings.py +++ b/chloro/settings.py @@ -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()) -- 2.39.2