From 61f1457453474fbda2348a6465cba48886222e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gremaud?= Date: Fri, 12 Jun 2026 02:28:48 +0200 Subject: [PATCH] fix(settings): use settings file if present else use env var --- highscore/app/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/highscore/app/config.py b/highscore/app/config.py index 3a4861e..a71be77 100644 --- a/highscore/app/config.py +++ b/highscore/app/config.py @@ -6,7 +6,11 @@ BASE_DIR = Path(__file__).resolve().parent.parent class Settings(BaseSettings): - model_config = SettingsConfigDict(env_file=BASE_DIR / ".env", env_file_encoding="utf-8") + _env_file = BASE_DIR / ".env" + model_config = SettingsConfigDict( + env_file=_env_file if _env_file.exists() else None, + env_file_encoding="utf-8", + ) django_secret_key: str = "" debug: bool = True