4
from dotenv import load_dotenv
5
from pydantic import BaseConfig
7
from core.db_config import Config as CoreConfig
9
BaseConfig.arbitrary_types_allowed = True
10
logging.basicConfig(level=logging.INFO)
17
Метод для удобного импорта адаптеров по пути
19
components = name.split('.')
20
mod = __import__(components[0])
21
for comp in components[1:]:
22
mod = getattr(mod, comp)
26
class Config(CoreConfig):
27
BROKER_PATH: str = 'app.front.front_server:app'
30
'DOMAIN': f'{os.environ.get("BUS_DOMAIN")}' or '127.0.0.1',
34
'DOMAIN': f'http://{os.environ.get("BASIC_DOMAIN")}' or '127.0.0.1',
38
'DOMAIN': f'http://{os.environ.get("INVENTORY_DOMAIN")}' or '127.0.0.1',
42
css_engine: str = '1tailwind'
43
style: str = 'good_html'
46
class DevelopmentConfig(Config):
48
class DockerConfig(Config):
49
APP_HOST: str = 'front_app'
52
class LocalConfig(Config):
56
class ProductionConfig(Config):
61
env = os.getenv("ENV", "local")
62
for name, value in os.environ.items():
67
"dev": DevelopmentConfig(),
68
"local": LocalConfig(),
69
"docker": DockerConfig(),
70
"prod": ProductionConfig(),
72
return config_type[env]
75
config: Config = get_config()