Implement pydantic .env loader

This commit is contained in:
Iam54r1n4
2025-02-03 19:03:00 +00:00
parent 11e1a7c33a
commit 8dda44664e
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1 @@
from .config import CONFIGS

View File

@ -0,0 +1,16 @@
from pydantic_settings import BaseSettings
class Configs(BaseSettings):
ADMIN_USERNAME: str
ADMIN_PASSWORD: str
API_TOKEN: str
EXPIRATION_MINUTES: int
DEBUG: bool
class Config:
env_file = '.env'
env_file_encoding = 'utf-8'
CONFIGS = Configs() # type: ignore