Skip to content

Commit 036e563

Browse files
authored
Revert "Revert "Move all the complex settings types to a module""
1 parent e416d6c commit 036e563

File tree

3 files changed

+196
-212
lines changed

3 files changed

+196
-212
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ Google Cloud SQL database connections from within Google Cloud Run are supported
8686
Alternatively you can set all your databases at once, by using the `DATABASES` setting (either in a `PydanticSettings` sub-class or via the `DJANGO_DATABASES` environment variable:
8787

8888
```python
89+
from pydantic_settings import PydanticSettings, types
90+
91+
8992
def MySettings(PydanticSettings):
90-
DATABASES = {"default": "sqlite:///db.sqlite3"} # type: ignore
93+
DATABASES: types.DATABASES = {"default": "sqlite:///db.sqlite3"} # type: ignore
9194
```
9295

9396
It is also possible to configure additional database connections with environment variables in the same way as the default `DATABASE_URL` configuration by using a `Field` that has a `configure_database` argument that points to the database alias in the `DATABASES` dictionary.

0 commit comments

Comments
 (0)