This repository has been archived on 2023-09-24. You can view files and clone it, but cannot push or open issues or pull requests.
takahe/core/config.py

21 lines
425 B
Python
Raw Normal View History

2022-11-13 06:10:06 +01:00
import pydantic
2022-11-05 21:17:27 +01:00
2022-11-13 06:10:06 +01:00
class Config(pydantic.BaseModel):
# Basic configuration options
site_name: str = "takahē"
identity_max_age: int = 24 * 60 * 60
# Cached ORM object storage
__singleton__ = None
class Config:
env_prefix = "takahe_"
@classmethod
def load(cls) -> "Config":
if cls.__singleton__ is None:
cls.__singleton__ = cls()
return cls.__singleton__