d50c1c5bba
- Added .env.example for environment variable configuration. - Created app initialization files and core settings management. - Implemented API routers for reporting and transaction endpoints. - Developed transaction management service with CRUD operations. - Integrated Azure OAuth for user authentication. - Designed dashboard view with transaction filtering and display. - Added Swagger UI documentation with custom dark theme. - Created static and template files for frontend styling and layout.
27 lines
736 B
Python
27 lines
736 B
Python
from functools import lru_cache
|
|
from os import getenv
|
|
from pathlib import Path
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[2]
|
|
load_dotenv(PROJECT_ROOT / ".env")
|
|
|
|
|
|
class Settings:
|
|
def __init__(self) -> None:
|
|
self.session_secret_key = getenv("SESSION_SECRET_KEY", "change-me-in-production")
|
|
self.azure_tenant_id = getenv("AZURE_TENANT_ID")
|
|
self.azure_client_id = getenv("AZURE_CLIENT_ID")
|
|
self.azure_client_secret = getenv("AZURE_CLIENT_SECRET")
|
|
|
|
@property
|
|
def azure_configured(self) -> bool:
|
|
return bool(self.azure_tenant_id and self.azure_client_id and self.azure_client_secret)
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|