Automated Action c2506a9e3f Fix Alembic migration error by adding project root to Python path and updating Pydantic config
- Added project root directory to Python path in alembic/env.py
- Updated Pydantic Settings class to use ClassVar typing for DB_DIR
- Updated Config class to new Pydantic v2 model_config format

generated with BackendIM... (backend.im)
2025-05-12 12:36:07 +00:00

36 lines
928 B
Python

from pathlib import Path
from typing import List, ClassVar
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
# Base settings
PROJECT_NAME: str = "Retail Management and Payment API"
API_V1_STR: str = "/api/v1"
# CORS
CORS_ORIGINS: List[str] = ["*"]
# JWT
JWT_SECRET_KEY: str = "your-secret-key-change-in-production"
JWT_ALGORITHM: str = "HS256"
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
# Database
DB_DIR: ClassVar[Path] = Path("/app") / "storage" / "db"
DB_DIR.mkdir(parents=True, exist_ok=True)
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
# Stripe
STRIPE_API_KEY: str = "your-stripe-api-key"
STRIPE_WEBHOOK_SECRET: str = "your-stripe-webhook-secret"
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": True
}
settings = Settings()