From c1c3f01aba52eacb2f523cb93afeed0b0863797f Mon Sep 17 00:00:00 2001 From: Murhu Markus Date: Fri, 20 Aug 2021 10:53:52 +0300 Subject: [PATCH] Add customizable environment variable setting prefix --- aplus/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aplus/settings.py b/aplus/settings.py index a45a823a5..262287c24 100644 --- a/aplus/settings.py +++ b/aplus/settings.py @@ -435,8 +435,11 @@ update_settings_with_file(__name__, environ.get('APLUS_LOCAL_SETTINGS', 'local_settings'), quiet='APLUS_LOCAL_SETTINGS' in environ) + update_settings_from_environment(__name__, 'DJANGO_') # FIXME: deprecated. was used with containers before, so keep it here for now. -update_settings_from_environment(__name__, 'APLUS_') +# Load settings from environment variables starting with ENV_SETTINGS_PREFIX (default APLUS_) +ENV_SETTINGS_PREFIX = environ.get('ENV_SETTINGS_PREFIX', 'APLUS_') +update_settings_from_environment(__name__, ENV_SETTINGS_PREFIX) update_secret_from_file(__name__, environ.get('APLUS_SECRET_KEY_FILE', 'secret_key')) # Complain if BASE_URL is not set