Fix deployment error with pydantic_settings

- Add pydantic-settings to requirements.txt
- Update config.py to handle missing pydantic_settings module
- Use fallback to regular pydantic BaseSettings if pydantic_settings is not available
This commit is contained in:
Automated Action 2025-05-17 13:38:59 +00:00
parent b0d71975a9
commit 163b82dab7
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,10 @@
from pathlib import Path
from pydantic_settings import BaseSettings
# Try to import from pydantic_settings, fall back to pydantic if not available
try:
from pydantic_settings import BaseSettings
except ImportError:
from pydantic import BaseSettings
class Settings(BaseSettings):

View File

@ -3,5 +3,6 @@ uvicorn>=0.15.0
sqlalchemy>=1.4.0
alembic>=1.7.0
pydantic>=2.0.0
pydantic-settings>=2.0.0
python-dotenv>=0.19.0
ruff>=0.0.270