Automated Action b315ed6c34 Fix alembic migration module import error
- Fixed Python import path in alembic/env.py
- Added settings import to ensure consistent database URL
- Synchronized database configuration between app and alembic

generated with BackendIM... (backend.im)
2025-05-15 22:10:23 +00:00

26 lines
608 B
Python

import os
from pathlib import Path
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
# Project settings
PROJECT_NAME: str = "Todo API"
API_V1_STR: str = "/api/v1"
DEBUG: bool = True
# Server settings
HOST: str = "0.0.0.0"
PORT: int = 8000
# Database settings
DB_DIR: Path = Path("/app") / "storage" / "db"
DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
settings = Settings()
# Ensure DB directory exists
settings.DB_DIR.mkdir(parents=True, exist_ok=True)