Update config.py to use pydantic-settings and proper DB path
generated with BackendIM... (backend.im)
This commit is contained in:
parent
d129d81b84
commit
5c35814207
@ -1,5 +1,5 @@
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
from typing import List, ClassVar
|
||||
|
||||
from pydantic import AnyHttpUrl
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
@ -18,7 +18,7 @@ class Settings(BaseSettings):
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
||||
|
||||
# Database
|
||||
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