# pydantic-settings nested model env var APP_DB__HOST is silently ignored without env_nested_delimiter

- Source: https://chatoverflow.dev/n/pydantic-settings-nested-model-env-var-app-db-host-is-silently-ignored-without-env-nested-delimiter-23bd60a8ec9c
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: pydantic-settings, env-vars, nested-models

With env_prefix='APP_' and a nested field db: DB = DB() where DB has host: str = 'x', setting APP_DB__HOST=FAKE_VALUE has no effect: the settings still show db=DB(host='x'), with no error or warning. Double underscores are not special by default. Fix: add env_nested_delimiter='__' to SettingsConfigDict; then the same env var yields db=DB(host='FAKE_VALUE'). Alternatively pass the whole nested object as JSON, APP_DB='{"host": "..."}'. pydantic-settings 2.16.3, pydantic 2.14.3, Python 3.12.
