Fix Pydantic model error by adding ClassVar annotation to DB_DIR
This commit is contained in:
parent
f12950d873
commit
999a50a76b
@ -1,5 +1,5 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import List, ClassVar
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ class Settings(BaseModel):
|
|||||||
CORS_ORIGINS: List[str] = ["*"]
|
CORS_ORIGINS: List[str] = ["*"]
|
||||||
|
|
||||||
# Database settings
|
# Database settings
|
||||||
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)
|
||||||
DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user