Fix dependency issue by replacing pydantic_settings with standard Pydantic BaseModel
This commit is contained in:
parent
e3a20d9c4b
commit
5886399eb2
@ -1,11 +1,10 @@
|
||||
from pathlib import Path
|
||||
from pydantic import field_validator
|
||||
from pydantic_settings import BaseSettings
|
||||
from pydantic import BaseModel, field_validator
|
||||
|
||||
# Build paths
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||
|
||||
class Settings(BaseSettings):
|
||||
class Settings(BaseModel):
|
||||
PROJECT_NAME: str = "Barebones Todo API"
|
||||
API_V1_STR: str = "/api/v1"
|
||||
|
||||
@ -21,8 +20,11 @@ class Settings(BaseSettings):
|
||||
db_dir.mkdir(parents=True, exist_ok=True)
|
||||
return v
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
case_sensitive = True
|
||||
# Load settings from environment variables
|
||||
model_config = {
|
||||
"env_file": ".env",
|
||||
"case_sensitive": True,
|
||||
}
|
||||
|
||||
# Create settings instance
|
||||
settings = Settings()
|
Loading…
x
Reference in New Issue
Block a user