fix(settings): use settings file if present else use env var
This commit is contained in:
parent
d7014f1cf8
commit
61f1457453
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user