Buckets:
AnonymousSpottedToad/human_verified_bucket / codebase /python /nijaru_zenith /examples /task-api /app /config.py
| """ | |
| Application configuration with environment variables. | |
| """ | |
| import os | |
| from functools import lru_cache | |
| class Settings: | |
| """Application settings.""" | |
| # Application | |
| APP_NAME: str = os.getenv("APP_NAME", "TaskFlow API") | |
| APP_VERSION: str = os.getenv("APP_VERSION", "1.0.0") | |
| DEBUG: bool = os.getenv("DEBUG", "true").lower() == "true" | |
| # Server | |
| HOST: str = os.getenv("HOST", "0.0.0.0") | |
| PORT: int = int(os.getenv("PORT", "8000")) | |
| # Database | |
| DATABASE_URL: str = os.getenv("DATABASE_URL", "sqlite+aiosqlite:///./taskflow.db") | |
| # Security | |
| SECRET_KEY: str = os.getenv("SECRET_KEY", "development-secret-change-in-production") | |
| ALGORITHM: str = os.getenv("ALGORITHM", "HS256") | |
| ACCESS_TOKEN_EXPIRE_MINUTES: int = int( | |
| os.getenv("ACCESS_TOKEN_EXPIRE_MINUTES", "30") | |
| ) | |
| # Email (optional) | |
| SMTP_HOST: str | None = os.getenv("SMTP_HOST") | |
| SMTP_PORT: int = int(os.getenv("SMTP_PORT", "587")) | |
| SMTP_USER: str | None = os.getenv("SMTP_USER") | |
| SMTP_PASSWORD: str | None = os.getenv("SMTP_PASSWORD") | |
| def is_production(self) -> bool: | |
| return not self.DEBUG | |
| def is_development(self) -> bool: | |
| return self.DEBUG | |
| def get_settings() -> Settings: | |
| """Get cached settings instance.""" | |
| return Settings() | |
| settings = get_settings() | |
Xet Storage Details
- Size:
- 1.36 kB
- Xet hash:
- 1fa76ea643cb0ee2a78a3fc091e70a303aab8e8debcef0478c1f858b3b981765
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.