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):
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue