from functools import lru_cache from pydantic_settings import BaseSettings class Settings(BaseSettings): DATABASE_URL: str SECRET_KEY: str ALGORITHM: str = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES: int = 30 REFRESH_TOKEN_EXPIRE_DAYS: int = 7 DEBUG: bool = False API_V1_PREFIX: str = "/api/v1" ALLOWED_ORIGINS: str = "http://localhost:3000" @property def origins_list(self) -> list[str]: return [o.strip() for o in self.ALLOWED_ORIGINS.split(",")] class Config: env_file = ".env" @lru_cache() def get_settings() -> Settings: return Settings()