Spaces:
No application file
No application file
| """ | |
| Configuration management for the application. | |
| Loads environment variables and provides application settings. | |
| """ | |
| from pydantic_settings import BaseSettings | |
| from typing import Optional | |
| class Settings(BaseSettings): | |
| """Application settings loaded from environment variables.""" | |
| # JWT Configuration | |
| JWT_SECRET: str | |
| JWT_ALGORITHM: str = "HS256" | |
| JWT_EXPIRATION_DAYS: int = 7 | |
| # Database Configuration | |
| DATABASE_URL: str | |
| # Application Configuration | |
| APP_NAME: str = "Todo API" | |
| DEBUG: bool = False | |
| # CORS Configuration | |
| CORS_ORIGINS: list[str] = [ | |
| "http://localhost:3000", | |
| "http://127.0.0.1:3000" | |
| ] | |
| class Config: | |
| env_file = ".env" | |
| case_sensitive = True | |
| extra = "ignore" | |
| # Global settings instance | |
| settings = Settings() | |