25 lines
757 B
Python
25 lines
757 B
Python
import os
|
|
from pathlib import Path
|
|
from pydantic_settings import BaseSettings
|
|
from functools import lru_cache
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
DATABASE_URL: str = "postgresql+asyncpg://aegisone:aegisone_pass@localhost:5432/aegisone"
|
|
SECRET_KEY: str = "change-me-to-random-string"
|
|
SESSION_TTL: int = 3600
|
|
APP_ENV: str = "development"
|
|
LOG_LEVEL: str = "debug"
|
|
DOCS_DIR: str = str(Path(__file__).parent.parent.parent / "docs")
|
|
PERMISSIONS_DIR: str = str(Path(__file__).parent.parent.parent / "permissions")
|
|
UPLOADS_DIR: str = str(Path(__file__).parent.parent.parent / "uploads")
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
return Settings()
|