|
|
"""
|
|
|
Numidium Backend Configuration
|
|
|
"""
|
|
|
from pydantic_settings import BaseSettings
|
|
|
from functools import lru_cache
|
|
|
import os
|
|
|
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
|
"""Application settings"""
|
|
|
|
|
|
|
|
|
app_name: str = "Numidium"
|
|
|
app_version: str = "0.1.0"
|
|
|
debug: bool = False
|
|
|
|
|
|
|
|
|
database_url: str = "sqlite:///./data/numidium.db"
|
|
|
|
|
|
|
|
|
newsapi_key: str = ""
|
|
|
|
|
|
|
|
|
cors_origins: list[str] = ["*"]
|
|
|
|
|
|
class Config:
|
|
|
env_file = ".env"
|
|
|
env_file_encoding = "utf-8"
|
|
|
|
|
|
|
|
|
@lru_cache()
|
|
|
def get_settings() -> Settings:
|
|
|
"""Get cached settings"""
|
|
|
return Settings()
|
|
|
|
|
|
|
|
|
settings = get_settings()
|
|
|
|