Spaces:
Runtime error
Runtime error
| from functools import lru_cache | |
| from pydantic import Field, field_validator | |
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| class Settings(BaseSettings): | |
| app_name: str = "Two Wheeler Scorecard API" | |
| environment: str = "local" | |
| database_url: str = "sqlite:///./scorecard.db" | |
| redis_url: str | None = None | |
| jwt_secret_key: str = "change-me" | |
| jwt_algorithm: str = "HS256" | |
| access_token_expire_minutes: int = 60 | |
| default_tenant_id: str = "default" | |
| default_product_type: str = "TWO_WHEELER_LOAN" | |
| enable_auth: bool = Field(default=False) | |
| model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8") | |
| def normalize_database_url(cls, value: str) -> str: | |
| if value.startswith("postgresql://"): | |
| return value.replace("postgresql://", "postgresql+psycopg://", 1) | |
| return value | |
| def get_settings() -> Settings: | |
| return Settings() | |