From 6766900bcef072d7791845fb6de2b486456bcd89 Mon Sep 17 00:00:00 2001 From: Ernesto Rico Schmidt <ernesto@helsinki.at> Date: Tue, 9 Jul 2024 18:20:36 -0400 Subject: [PATCH] feat: add logic to override the settings --- steering/settings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/steering/settings.py b/steering/settings.py index 8ae8ca0c..773bf3ca 100644 --- a/steering/settings.py +++ b/steering/settings.py @@ -1,4 +1,5 @@ import os +import sys from pathlib import Path import ldap @@ -242,3 +243,12 @@ LOGGING = { }, }, } + +# ATTENTION: +# Don’t add any configuration settings after this, so that administrators can override them. +try: + sys.path.insert(0, "/etc/steering") + from steering_settings import * # noqa: F401,F403 +except ImportError: + if os.path.exists("/etc/steering/steering_settings.py"): + raise -- GitLab