Fix ModuleNotFoundError for pydantic_settings by using standard pydantic
This commit is contained in:
parent
741f301b11
commit
4857a0347c
@ -1,10 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from pydantic_settings import BaseSettings
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseSettings):
|
class Settings(BaseModel):
|
||||||
PROJECT_NAME: str = "Notes API"
|
PROJECT_NAME: str = "Notes API"
|
||||||
API_V1_STR: str = "/api/v1"
|
API_V1_STR: str = "/api/v1"
|
||||||
|
|
||||||
@ -20,8 +20,10 @@ class Settings(BaseSettings):
|
|||||||
# CORS
|
# CORS
|
||||||
CORS_ORIGINS: list[str] = ["*"]
|
CORS_ORIGINS: list[str] = ["*"]
|
||||||
|
|
||||||
class Config:
|
model_config = {
|
||||||
env_file = ".env"
|
"env_file": ".env",
|
||||||
case_sensitive = True
|
"case_sensitive": True,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user