Add Docker secrets support in config (#6250)

* Add Docker secrets support in config

* ruff format

* Remove gracefully fallback exception handling

* Add support for loading secret fallbacks from environment file
This commit is contained in:
KarlKeu00
2026-07-06 15:09:31 +02:00
committed by GitHub
parent 3270c4e583
commit 3ae9aabcfb
2 changed files with 36 additions and 6 deletions
+5
View File
@@ -100,6 +100,11 @@ SECRET_KEY_FALLBACKS = []
for i in range(10):
if config.has_option('django', f'secret_fallback{i}'):
SECRET_KEY_FALLBACKS.append(config.get('django', f'secret_fallback{i}'))
fallback_secret_file_key = config._file_envkey('django', 'secret_fallbacks') # FILE__PRETIX_DJANGO_SECRET_FALLBACKS
if fallback_secret_file_key in os.environ and os.path.exists(os.environ[fallback_secret_file_key]):
with open(os.environ[fallback_secret_file_key], 'r') as f:
for line in f:
SECRET_KEY_FALLBACKS.append(line.strip())
# Adjustable settings