From b2d781d451b613a03b15c6de9aac8e9e2eac8bcc Mon Sep 17 00:00:00 2001 From: Markus Wanner Date: Sun, 24 Nov 2024 18:40:58 +0100 Subject: [PATCH] Allow loading settings from outside of the postgresqleu tree To ease building docker images and prevent having to maintain an in-tree file for local settings, allow a pgeu_system_settings module anywhere in the PYTHONPATH for configuration. --- postgresqleu/settings.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/postgresqleu/settings.py b/postgresqleu/settings.py index 0b7996ec..815d8c9a 100644 --- a/postgresqleu/settings.py +++ b/postgresqleu/settings.py @@ -307,7 +307,13 @@ try: from .local_settings import * except ImportError as e: - pass + # If there's no local_settings.py within the postgresqleu tree, check + # for a globally available pgeu_system_settings module in any configured + # PYTHONPATH. + try: + from pgeu_system_settings import * + except ImportError as e: + pass PRELOAD_URLS = [] if 'SYSTEM_SKIN_DIRECTORY' in globals():