Описаны настройки
This commit is contained in:
parent
3797e39866
commit
f5c8eb2f6b
19
settings.py
19
settings.py
|
@ -1,11 +1,20 @@
|
|||
from dataclasses import dataclass, field
|
||||
import os
|
||||
|
||||
from pydantic import BaseSettings, validator
|
||||
from environs import load_dotenv
|
||||
from typing import List
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
class ApiConfig(BaseSettings):
|
||||
host: str = os.environ.get('API_HOST')
|
||||
token: str = os.environ.get('API_TOKEN')
|
||||
@dataclass
|
||||
class ApiConfig:
|
||||
host: str = os.getenv('API_HOST')
|
||||
token: str = os.getenv('API_TOKEN')
|
||||
iblocks: List[str] = field(default_factory=lambda: os.getenv('IBLOCKS').split(','))
|
||||
|
||||
|
||||
@dataclass
|
||||
class EtlConfig:
|
||||
host: str = os.environ.get('DESTINATION_HOST')
|
||||
port: int = int(os.environ.get('DESTINATION_PORT'))
|
||||
protocol: str = os.environ.get('DESTINATION_PROTOCOL')
|
||||
|
|
Loading…
Reference in New Issue
Block a user