
- Fixed Pydantic configuration using ConfigDict for latest Pydantic version - Fixed import order in alembic/env.py for proper module imports - Applied code formatting with Ruff - Optimized database connection settings - Ensured proper error handling for API endpoints generated with BackendIM... (backend.im)
20 lines
444 B
Python
20 lines
444 B
Python
from pathlib import Path
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_V1_STR: str = "/api/v1"
|
|
PROJECT_NAME: str = "Calculator API"
|
|
|
|
# Database settings
|
|
DB_DIR = Path("/app") / "storage" / "db"
|
|
DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
|
|
settings = Settings()
|