пиздец поколение ленивых

This commit is contained in:
dderbentsov
2023-07-18 01:59:11 +03:00
parent 00925b2a93
commit e6918c6e51

View File

@@ -9,25 +9,25 @@ class Settings(BaseSettings):
@lru_cache @lru_cache
def get_settings() -> Settings: def get_settings() -> Settings:
settings = Settings() # type: ignore settings = Settings() # type: ignore
print('333333333333333333333333333333333333333333')
print(settings) # if (db := getenv("POSTGRES_DB")) is not None:
print(getenv("POSTGRES_DB")) # # settings.database_url = PostgresDsn.build(
if (db := getenv("POSTGRES_DB")) is not None: # # scheme="postgresql",
# settings.database_url = PostgresDsn.build( # # user=settings.database_url.user,
# scheme="postgresql", # # password=settings.database_url.password,
# user=settings.database_url.user, # # host=settings.database_url.host,
# password=settings.database_url.password, # # port=settings.database_url.port,
# host=settings.database_url.host, # # path=f"/{db}",
# port=settings.database_url.port, # # )
# path=f"/{db}", # settings.database_url = PostgresDsn.build(
# ) # scheme="postgresql",
settings.database_url = PostgresDsn.build( # user='barbie',
scheme="postgresql", # password='redStar4,1',
user='barbie', # host='localhost',
password='redStar4,1', # port='5432',
host='localhost', # path=f"/{db}",
port='5432', # )
path=f"/{db}", if (db := getenv("CONNECTION_STRING")) is not None:
) settings.database_url = getenv("CONNECTION_STRING")
#CONTINUE
return settings return settings