Fix pydantic error by adding ClassVar type annotation to DB_DIR
generated with BackendIM... (backend.im)
This commit is contained in:
parent
f047098f40
commit
a46b44fcec
@ -1,4 +1,4 @@
|
||||
from typing import List, Optional, Union
|
||||
from typing import List, Optional, Union, ClassVar
|
||||
from pathlib import Path
|
||||
from pydantic import AnyHttpUrl, validator
|
||||
from pydantic_settings import BaseSettings
|
||||
@ -6,7 +6,7 @@ from pydantic_settings import BaseSettings
|
||||
class Settings(BaseSettings):
|
||||
API_V1_STR: str = "/api/v1"
|
||||
PROJECT_NAME: str = "Quick REST API Service"
|
||||
|
||||
|
||||
# CORS settings
|
||||
BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = []
|
||||
|
||||
@ -19,7 +19,7 @@ class Settings(BaseSettings):
|
||||
raise ValueError(v)
|
||||
|
||||
# Database settings
|
||||
DB_DIR = Path("/app/storage/db")
|
||||
DB_DIR: ClassVar[Path] = Path("/app/storage/db")
|
||||
DB_DIR.mkdir(parents=True, exist_ok=True)
|
||||
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user