fix: Cleaning up the code base
This commit is contained in:
@@ -10,7 +10,12 @@ class Settings(BaseSettings):
|
||||
# =========================
|
||||
# DATABASE
|
||||
# =========================
|
||||
DATABASE_URL: str
|
||||
DATABASE_HOST: str
|
||||
DATABASE_PORT: int
|
||||
DATABASE_USER: str
|
||||
DATABASE_PASSWORD: str
|
||||
DATABASE_NAME: str
|
||||
DATABASE_DRIVER: str
|
||||
|
||||
# =========================
|
||||
# FASTAPI
|
||||
@@ -61,6 +66,10 @@ class Settings(BaseSettings):
|
||||
# =========================
|
||||
ORJSON_STRICT: bool = True
|
||||
|
||||
@property
|
||||
def database_url(self) -> str:
|
||||
return f"mysql+<driver>://{self.DATABASE_USER}:{self.DATABASE_PASSWORD}@{self.DATABASE_HOST}:{self.DATABASE_PORT}/{self.DATABASE_NAME}"
|
||||
|
||||
@property
|
||||
def access_token_expire(self) -> timedelta:
|
||||
return timedelta(minutes=self.ACCESS_TOKEN_EXPIRE_MINUTES)
|
||||
@@ -70,6 +79,4 @@ class Settings(BaseSettings):
|
||||
env_file_encoding = "utf-8"
|
||||
|
||||
# Instance globale
|
||||
settings = Settings()
|
||||
|
||||
print("test")
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user