selecta-highscore/highscore/app/config.py

30 lines
738 B
Python

from pathlib import Path
from pydantic_settings import BaseSettings, SettingsConfigDict
BASE_DIR = Path(__file__).resolve().parent.parent
class Settings(BaseSettings):
_env_file = BASE_DIR / ".env"
model_config = SettingsConfigDict(
env_file=_env_file if _env_file.exists() else None,
env_file_encoding="utf-8",
)
django_secret_key: str = ""
debug: bool = True
allowed_hosts: list[str] = []
installed_apps: list[str] = []
api_secret: str = "selecta-secret"
db_engine: str = "django.db.backends.postgresql"
db_name: str = "selecta-highscore"
db_user: str = "postgres"
db_password: str = ""
db_host: str = "localhost"
db_port: int = 5432
settings = Settings()