from pydantic_settings import BaseSettings, SettingsConfigDict from pathlib import Path class Settings(BaseSettings): model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8") database_url: str = "postgresql+asyncpg://homehub:homehub@localhost:5432/homehub" upload_dir: str = "/uploads" cors_origins: str = "http://localhost:3000" @property def cors_origins_list(self) -> list[str]: return [o.strip() for o in self.cors_origins.split(",")] @property def upload_path(self) -> Path: return Path(self.upload_dir) settings = Settings()