Files
school_compare/backend/config.py
Tudor Sitaru 54e4bc2e77
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m7s
Refactoring and bug fixes
2026-01-06 16:30:32 +00:00

39 lines
867 B
Python

"""
Application configuration using pydantic-settings.
Loads from environment variables and .env file.
"""
from pathlib import Path
from typing import List
from pydantic_settings import BaseSettings
import os
class Settings(BaseSettings):
"""Application settings loaded from environment."""
# Paths
data_dir: Path = Path(__file__).parent.parent / "data"
frontend_dir: Path = Path(__file__).parent.parent / "frontend"
# Server
host: str = "0.0.0.0"
port: int = 80
# CORS
allowed_origins: List[str] = ["https://schoolcompare.co.uk", "http://localhost:8000", "http://localhost:3000"]
# API
default_page_size: int = 50
max_page_size: int = 100
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
extra = "ignore"
# Singleton instance
settings = Settings()