Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_tinkoff_invest_robot-main/settings.py
5925 views
1
from pydantic import BaseSettings, ValidationError
2
from loguru import logger
3
4
5
class Settings(BaseSettings):
6
api_token: str
7
api_token_sandbox: str | None
8
app_name: str = 'yurgers'
9
10
flask_run_host: str = "127.0.0.1"
11
flask_run_port: int = 8000
12
13
try:
14
settings = Settings()
15
16
except ValidationError as err:
17
logger.error(str(err))
18
exit(-1)
19
20