Fix Pydantic type annotation for DB_DIR in Settings class
This commit is contained in:
parent
600c8b17af
commit
fd7eca550f
@ -1,5 +1,5 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import ClassVar, List
|
||||||
|
|
||||||
from pydantic_settings import BaseSettings
|
from pydantic_settings import BaseSettings
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ class Settings(BaseSettings):
|
|||||||
CORS_ORIGINS: List[str] = ["http://localhost:3000", "http://localhost:8000"]
|
CORS_ORIGINS: List[str] = ["http://localhost:3000", "http://localhost:8000"]
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
DB_DIR = Path("/app/storage/db")
|
DB_DIR: ClassVar[Path] = Path("/app/storage/db")
|
||||||
DB_DIR.mkdir(parents=True, exist_ok=True)
|
DB_DIR.mkdir(parents=True, exist_ok=True)
|
||||||
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user