19 lines
516 B
Python
19 lines
516 B
Python
from functools import lru_cache
|
|
from pathlib import Path
|
|
|
|
from pydantic import Field
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
database_url: str = "sqlite:///./poster-studio.db"
|
|
asset_root: Path = Path("./data/assets")
|
|
admin_token: str = Field(default="", repr=False)
|
|
max_upload_bytes: int = 15 * 1024 * 1024
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|