todoapp-us6a2a/app/core/config.py
Automated Action e01f3a4d57 Create FastAPI Todo App
Create a simple Todo API with FastAPI and SQLite with CRUD functionality,
health check, error handling, and API documentation.
2025-05-31 21:13:37 +00:00

22 lines
462 B
Python

from pathlib import Path
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
PROJECT_NAME: str = "Todo API"
API_V1_STR: str = "/api/v1"
# Database settings
DB_DIR: Path = Path("/app") / "storage" / "db"
DB_NAME: str = "db.sqlite"
class Config:
env_file = ".env"
case_sensitive = True
settings = Settings()
# Ensure DB directory exists
settings.DB_DIR.mkdir(parents=True, exist_ok=True)