import os from pathlib import Path from pydantic_settings import BaseSettings class Settings(BaseSettings): # API settings PROJECT_NAME: str = "Task Manager API" API_V1_STR: str = "/api/v1" DEBUG: bool = os.getenv("DEBUG", "False").lower() in ("true", "1", "t") # SQLite Database settings DB_DIR: Path = Path("/app") / "storage" / "db" class Config: env_file = ".env" case_sensitive = True # Create settings instance settings = Settings() # Ensure DB directory exists settings.DB_DIR.mkdir(parents=True, exist_ok=True)