Automated Action 168878cd6f Create Simple Todo Application with FastAPI and SQLite
- Set up project structure and dependencies
- Implement Todo model with SQLAlchemy
- Configure SQLite database connection
- Create Alembic migration scripts
- Implement RESTful API endpoints for CRUD operations
- Add health check endpoint
- Update README with documentation

generated with BackendIM... (backend.im)
2025-05-13 02:14:09 +00:00

18 lines
499 B
Python

from pathlib import Path
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
PROJECT_NAME: str = "Todo Application"
DB_DIR: Path = Path("/app") / "storage" / "db"
# This ensures the DB_DIR exists
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.DB_DIR.mkdir(parents=True, exist_ok=True)
@property
def SQLALCHEMY_DATABASE_URL(self) -> str:
return f"sqlite:///{self.DB_DIR}/db.sqlite"
settings = Settings()