Files
dodo/backend/config.py
T

24 lines
660 B
Python

from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
app_name: str = "dodo"
database_url: str = "postgresql+asyncpg://dodo:dodo@localhost:5432/dodo"
session_days: int = 30
cookie_secure: bool = False
trusted_proxies: str = ""
auto_create_schema: bool = False
attachment_dir: str = "./data/attachments"
attachment_max_mb: int = 20
login_attempts: int = 5
login_window_seconds: int = 300
model_config = SettingsConfigDict(env_prefix="DODO_", env_file=".env", extra="ignore")
@lru_cache
def get_settings() -> Settings:
return Settings()