Automated Action 9586f0c506 Fix Pydantic error by moving DB_DIR outside of Settings class
- 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)
2025-05-13 23:34:58 +00:00

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()