
- Moved DB_DIR Path definition outside Settings class to fix Pydantic 2.x annotation error - Updated path to use project-specific path rather than /app - Added start.py script to validate app loading generated with BackendIM... (backend.im)
19 lines
477 B
Python
19 lines
477 B
Python
from pydantic_settings import BaseSettings
|
|
from pathlib import Path
|
|
from typing import Optional, ClassVar
|
|
|
|
|
|
# Create DB directory outside of the Settings class
|
|
DB_DIR = Path("/projects/taskmanagerapi-8e2xek/app/storage/db")
|
|
DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_V1_STR: str = "/api/v1"
|
|
PROJECT_NAME: str = "Task Manager API"
|
|
|
|
# Database settings
|
|
DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
|
|
settings = Settings() |