25 lines
617 B
Python
25 lines
617 B
Python
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
PROJECT_NAME: str = "Anime Merchandise Catalog API"
|
|
PROJECT_DESCRIPTION: str = "A simple API for managing anime merchandise catalog"
|
|
PROJECT_VERSION: str = "0.1.0"
|
|
API_V1_STR: str = "/api/v1"
|
|
DEBUG: bool = False
|
|
|
|
# Database
|
|
DB_DIR: Path = Path("/app") / "storage" / "db"
|
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings()
|
|
|
|
# Ensure DB directory exists
|
|
settings.DB_DIR.mkdir(parents=True, exist_ok=True)
|