Files
homeschool-dashboard/backend/app/config.py
T
derekcandClaude Opus 5.5 954161ba8f v2026.10: monthly dependency update, switch to calendar versioning
- Frontend: vue 3.5.43, vite 8.3.4, @vitejs/plugin-vue 6.0.10, pinia 4.0.3
  (+ @vue/devtools-api 8.2.1 peer), vue-router 5.4.0; npm audit 6 -> 0
- package.json "type": "module"; vite.config.js resolves @ via import.meta.url
- Backend: fastapi 0.143.0, sqlalchemy 2.1.4, PyMySQL 1.2.3, aiomysql 0.3.2,
  uvicorn 0.54.0, httpx 0.28.1, pydantic 2.14.1, pydantic-settings 2.15.0,
  PyJWT 2.15.1, cryptography 50.0.2, email-validator 2.3.0
- Settings: class Config -> SettingsConfigDict (Pydantic V2 deprecation)
- python 3.12.15-slim base image
- Releases now tagged vYYYY.MM (README, Release-Notes/v2026.10.md)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 22:59:03 -07:00

28 lines
860 B
Python

from pydantic_settings import BaseSettings, SettingsConfigDict
from functools import lru_cache
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env")
database_url: str
secret_key: str
algorithm: str = "HS256"
access_token_expire_minutes: int = 30
refresh_token_expire_days: int = 30
cors_origins: str = "http://localhost:8054"
admin_username: str = "admin"
admin_password: str # no default — must be explicitly set in .env
docs_enabled: bool = False
ntfy_url: str = "" # e.g. https://ntfy.sh/your-secret-topic
ntfy_token: str = "" # optional Bearer token if topic is protected
@property
def cors_origins_list(self) -> list[str]:
return [o.strip() for o in self.cors_origins.split(",")]
@lru_cache
def get_settings() -> Settings:
return Settings()