fix: Cleaning up the code base

This commit is contained in:
Lino Mallevaey
2025-08-18 21:07:24 +02:00
parent 49bcb38261
commit 6f4dc2244a
6 changed files with 25 additions and 43 deletions

View File

@@ -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()