fix config

This commit is contained in:
itqop 2024-04-15 14:42:46 +03:00
parent 124405a829
commit 9cb00eec52
1 changed files with 6 additions and 6 deletions

View File

@ -5,11 +5,11 @@ import httpx
class Configs(BaseSettings):
HOST: str
PORT: PositiveInt
DATABASE: str
USERNAME: str
PASSWORD: str
DB_HOST: str
DB_PORT: PositiveInt
DB_NAME: str
DB_LOGIN: str
DB_PASSWORD: str
HOST_DS: str
PORT_DS: PositiveInt
TOKEN_DS: str
@ -17,7 +17,7 @@ class Configs(BaseSettings):
@computed_field
def DB_URI(self) -> MySQLDsn:
return Url(
f"mysql+aiomysql://{self.USERNAME}:{self.PASSWORD}@{self.HOST}:{self.PORT}/{self.DATABASE}?charset=utf8mb4"
f"mysql+aiomysql://{self.DB_LOGIN}:{self.DB_PASSWORD}@{self.DB_HOST}:{self.DB_PORT}/{self.DB_NAME}?charset=utf8mb4"
)
@computed_field