- "backend/main.py" - "backend/config.py" - "backend/schemas.py" - "backend/routers/__init__.py" - "backend/routers/health.py" - "backend/routers/creators.py" - "backend/routers/videos.py" GSD-Task: S01/T03
43 lines
1 KiB
Python
43 lines
1 KiB
Python
"""Application configuration loaded from environment variables."""
|
|
|
|
from functools import lru_cache
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Chrysopedia API settings.
|
|
|
|
Values are loaded from environment variables (or .env file via
|
|
pydantic-settings' dotenv support).
|
|
"""
|
|
|
|
# Database
|
|
database_url: str = "postgresql+asyncpg://chrysopedia:changeme@localhost:5433/chrysopedia"
|
|
|
|
# Redis
|
|
redis_url: str = "redis://localhost:6379/0"
|
|
|
|
# Application
|
|
app_env: str = "development"
|
|
app_log_level: str = "info"
|
|
app_secret_key: str = "changeme-generate-a-real-secret"
|
|
|
|
# CORS
|
|
cors_origins: list[str] = ["*"]
|
|
|
|
# File storage
|
|
transcript_storage_path: str = "/data/transcripts"
|
|
video_metadata_path: str = "/data/video_meta"
|
|
|
|
model_config = {
|
|
"env_file": ".env",
|
|
"env_file_encoding": "utf-8",
|
|
"case_sensitive": False,
|
|
}
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
"""Return cached application settings (singleton)."""
|
|
return Settings()
|