Create base_config

This commit is contained in:
Григорич 2023-05-19 16:42:26 +03:00
parent c29c7369a4
commit 9c5f74d515
3 changed files with 14 additions and 1 deletions

2
.env.dist Normal file
View File

@ -0,0 +1,2 @@
API_HOST=127.0.0.1
API_TOKEN=jmkdjsfopjsef

View File

@ -1,2 +1,2 @@
pydantic==1.10.7 pydantic==1.10.7
environs==9.5.0

11
settings.py Normal file
View File

@ -0,0 +1,11 @@
import os
from pydantic import BaseSettings, validator
from environs import load_dotenv
load_dotenv()
class ApiConfig(BaseSettings):
host: str = os.environ.get('API_HOST')
token: str = os.environ.get('API_TOKEN')