from __future__ import annotations from pathlib import Path from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): """Application settings loaded from environment variables.""" DEBUG: bool = True SECRET_KEY: str = "django-insecure-change-me-in-production" DATABASE_URL: str = "sqlite:///db.sqlite3" ALLOWED_HOSTS: list[str] = ["*"] CORS_ALLOWED_ORIGINS: list[str] = [ "http://localhost:3000", "http://localhost:5173", "http://127.0.0.1:3000", "http://127.0.0.1:5173", ] CORS_ALLOW_CREDENTIALS: bool = True BASE_DIR: Path = Path(__file__).resolve().parent.parent model_config = SettingsConfigDict( env_prefix="CR_", env_file=".env", env_file_encoding="utf-8", extra="ignore", ) settings = Settings()