Изменения pydantic схем
This commit is contained in:
parent
d85c9e5065
commit
5a9e2c5be5
3 changed files with 9 additions and 4 deletions
|
@ -6,6 +6,12 @@ DB_USER=
|
|||
DB_PASS=
|
||||
DB_NAME=
|
||||
|
||||
TEST_DB_HOST=
|
||||
TEST_DB_PORT=
|
||||
TEST_DB_USER=
|
||||
TEST_DB_PASS=
|
||||
TEST_DB_NAME=
|
||||
|
||||
SECRET_KEY=
|
||||
ALGORITHM=
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
from typing import Literal
|
||||
|
||||
from pydantic import ConfigDict
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = ConfigDict(env_file=".env")
|
||||
|
||||
MODE: Literal["DEV", "TEST", "PROD"]
|
||||
|
||||
DB_USER: str
|
||||
|
@ -31,8 +34,5 @@ class Settings(BaseSettings):
|
|||
|
||||
IMAGE_UPLOAD_SERVER: str
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
|
||||
|
||||
settings = Settings()
|
||||
|
|
|
@ -32,7 +32,6 @@ async def prepare_database():
|
|||
new_users = []
|
||||
for i in users:
|
||||
i['date_of_birth'] = datetime.strptime(i['date_of_birth'], '%Y-%m-%d')
|
||||
# i['date_of_birth'] = i['date_of_birth'].isoformat()
|
||||
new_users.append(i)
|
||||
|
||||
async with async_session_maker() as session:
|
||||
|
|
Loading…
Add table
Reference in a new issue