from functools import lru_cache from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): database_url: str = "postgresql+asyncpg://drivers:drivers@localhost:5432/drivers" bot_token: str = "" api_base_url: str = "http://localhost:8000" webapp_url: str = "http://localhost:8000" app_host: str = "0.0.0.0" app_port: int = 8000 model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore") @lru_cache def get_settings() -> Settings: return Settings() settings = get_settings()