fix config
This commit is contained in:
parent
124405a829
commit
9cb00eec52
12
config.py
12
config.py
|
@ -5,11 +5,11 @@ import httpx
|
||||||
|
|
||||||
|
|
||||||
class Configs(BaseSettings):
|
class Configs(BaseSettings):
|
||||||
HOST: str
|
DB_HOST: str
|
||||||
PORT: PositiveInt
|
DB_PORT: PositiveInt
|
||||||
DATABASE: str
|
DB_NAME: str
|
||||||
USERNAME: str
|
DB_LOGIN: str
|
||||||
PASSWORD: str
|
DB_PASSWORD: str
|
||||||
HOST_DS: str
|
HOST_DS: str
|
||||||
PORT_DS: PositiveInt
|
PORT_DS: PositiveInt
|
||||||
TOKEN_DS: str
|
TOKEN_DS: str
|
||||||
|
@ -17,7 +17,7 @@ class Configs(BaseSettings):
|
||||||
@computed_field
|
@computed_field
|
||||||
def DB_URI(self) -> MySQLDsn:
|
def DB_URI(self) -> MySQLDsn:
|
||||||
return Url(
|
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
|
@computed_field
|
||||||
|
|
Loading…
Reference in New Issue