diff --git a/app/core/config.py b/app/core/config.py index ccbd77d..8709271 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -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" @@ -20,9 +19,12 @@ class Settings(BaseSettings): if db_dir: db_dir.mkdir(parents=True, exist_ok=True) return v + + # Load settings from environment variables + model_config = { + "env_file": ".env", + "case_sensitive": True, + } - class Config: - env_file = ".env" - case_sensitive = True - +# Create settings instance settings = Settings() \ No newline at end of file