
- 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)
18 lines
499 B
Python
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() |