Closed red8888 closed 1 month ago
https://docs.pydantic.dev/1.10/usage/settings/#changing-priority
from pydantic import BaseSettings, PostgresDsn from pydantic.env_settings import SettingsSourceCallable class Settings(BaseSettings): database_dsn: PostgresDsn class Config: @classmethod def customise_sources( cls, init_settings: SettingsSourceCallable, env_settings: SettingsSourceCallable, file_secret_settings: SettingsSourceCallable, ) -> tuple[SettingsSourceCallable, ...]: return env_settings, init_settings, file_secret_settings print(Settings(database_dsn='postgres://postgres@localhost:5432/kwargs_db')) #> database_dsn=PostgresDsn('postgres://postgres@localhost:5432/env_db', )
It looks like pydantic.env_settings is empty? I can't import SettingsSourceCallable from it.
pydantic.env_settings
SettingsSourceCallable
Im dumb was looking at all old docs
https://docs.pydantic.dev/1.10/usage/settings/#changing-priority
It looks like
pydantic.env_settings
is empty? I can't importSettingsSourceCallable
from it.