work
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from functools import lru_cache
|
||||
from typing import Optional
|
||||
|
||||
from os import getenv
|
||||
from pydantic import BaseSettings, PostgresDsn
|
||||
|
||||
class Settings(BaseSettings):
|
||||
@@ -11,5 +11,23 @@ def get_settings() -> Settings:
|
||||
settings = Settings() # type: ignore
|
||||
print('333333333333333333333333333333333333333333')
|
||||
print(settings)
|
||||
print(getenv("POSTGRES_DB"))
|
||||
if (db := getenv("POSTGRES_DB")) is not None:
|
||||
# settings.database_url = PostgresDsn.build(
|
||||
# scheme="postgresql",
|
||||
# user=settings.database_url.user,
|
||||
# password=settings.database_url.password,
|
||||
# host=settings.database_url.host,
|
||||
# port=settings.database_url.port,
|
||||
# path=f"/{db}",
|
||||
# )
|
||||
settings.database_url = PostgresDsn.build(
|
||||
scheme="postgresql",
|
||||
user='barbie',
|
||||
password='redStar4,1',
|
||||
host='localhost',
|
||||
port='5432',
|
||||
path=f"/{db}",
|
||||
)
|
||||
#CONTINUE
|
||||
return settings
|
||||
Reference in New Issue
Block a user