Fix Pydantic BaseSettings url

This commit is contained in:
halon
2023-10-22 10:35:07 +02:00
committed by GitHub
parent d81098db5c
commit ae98be9cb4

View File

@@ -511,7 +511,7 @@ Will generate docs like this:
![FastAPI Generated Custom Response Docs](images/custom_responses.png "Custom Response Docs") ![FastAPI Generated Custom Response Docs](images/custom_responses.png "Custom Response Docs")
### 10. Use Pydantic's BaseSettings for configs ### 10. Use Pydantic's BaseSettings for configs
Pydantic gives a [powerful tool](https://pydantic-docs.helpmanual.io/usage/settings/) to parse environment variables and process them with its validators. Pydantic gives a [powerful tool](https://docs.pydantic.dev/latest/concepts/pydantic_settings/) to parse environment variables and process them with its validators.
```python ```python
from pydantic import AnyUrl, PostgresDsn from pydantic import AnyUrl, PostgresDsn
from pydantic_settings import BaseSettings # pydantic v2 from pydantic_settings import BaseSettings # pydantic v2