Fix pydantic settings issue in config.py
This commit is contained in:
parent
3b335fce18
commit
fa080b351e
@ -1,13 +1,12 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
from pydantic import field_validator
|
||||
from pydantic_settings import BaseSettings
|
||||
from pydantic import field_validator, BaseModel
|
||||
|
||||
# Project directories
|
||||
ROOT_DIR = Path(__file__).parent.parent.parent.resolve()
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
class Settings(BaseModel):
|
||||
# Project info
|
||||
PROJECT_NAME: str = "One-Time Secret Sharing Service"
|
||||
API_V1_STR: str = "/api/v1"
|
||||
@ -28,9 +27,10 @@ class Settings(BaseSettings):
|
||||
db_dir.mkdir(parents=True, exist_ok=True)
|
||||
return db_dir
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
case_sensitive = True
|
||||
model_config = {
|
||||
"env_file": ".env",
|
||||
"case_sensitive": True,
|
||||
}
|
||||
|
||||
|
||||
# Create global settings instance
|
||||
|
@ -4,6 +4,7 @@ SQLAlchemy>=2.0.9
|
||||
alembic>=1.10.4
|
||||
python-dotenv>=1.0.0
|
||||
pydantic>=2.0.0
|
||||
pydantic-settings>=2.0.0
|
||||
ruff>=0.0.262
|
||||
cryptography>=40.0.2
|
||||
asyncio>=3.4.3
|
||||
|
Loading…
x
Reference in New Issue
Block a user