From ea017c99198c73f0e4a67a758bc5113e2cca6102 Mon Sep 17 00:00:00 2001 From: Teofilo Zosa Date: Fri, 19 Aug 2022 05:12:34 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20misc=20dependency=20instal?= =?UTF-8?q?ls=20to=20tutorial=20docs=20(#2126)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/en/docs/advanced/websockets.md | 14 ++++++++++++++ docs/en/docs/tutorial/response-model.md | 6 ++++++ docs/en/docs/tutorial/sql-databases.md | 14 ++++++++++++++ docs/en/docs/tutorial/testing.md | 5 +++++ 4 files changed, 39 insertions(+) diff --git a/docs/en/docs/advanced/websockets.md b/docs/en/docs/advanced/websockets.md index 878ad37dd..0e9bc5b06 100644 --- a/docs/en/docs/advanced/websockets.md +++ b/docs/en/docs/advanced/websockets.md @@ -2,6 +2,20 @@ You can use WebSockets with **FastAPI**. +## Install `WebSockets` + +First you need to install `WebSockets`: + +
+ +```console +$ pip install websockets + +---> 100% +``` + +
+ ## WebSockets client ### In production diff --git a/docs/en/docs/tutorial/response-model.md b/docs/en/docs/tutorial/response-model.md index e371e86e4..2bbd4d4fd 100644 --- a/docs/en/docs/tutorial/response-model.md +++ b/docs/en/docs/tutorial/response-model.md @@ -61,6 +61,12 @@ Here we are declaring a `UserIn` model, it will contain a plaintext password: {!> ../../../docs_src/response_model/tutorial002_py310.py!} ``` +!!! info + To use `EmailStr`, first install `email_validator`. + + E.g. `pip install email-validator` + or `pip install pydantic[email]`. + And we are using this model to declare our input and the same model to declare our output: === "Python 3.6 and above" diff --git a/docs/en/docs/tutorial/sql-databases.md b/docs/en/docs/tutorial/sql-databases.md index 3436543a5..5ccaf05ec 100644 --- a/docs/en/docs/tutorial/sql-databases.md +++ b/docs/en/docs/tutorial/sql-databases.md @@ -80,6 +80,20 @@ The file `__init__.py` is just an empty file, but it tells Python that `sql_app` Now let's see what each file/module does. +## Install `SQLAlchemy` + +First you need to install `SQLAlchemy`: + +
+ +```console +$ pip install sqlalchemy + +---> 100% +``` + +
+ ## Create the SQLAlchemy parts Let's refer to the file `sql_app/database.py`. diff --git a/docs/en/docs/tutorial/testing.md b/docs/en/docs/tutorial/testing.md index fea5a54f5..79ea2b1ab 100644 --- a/docs/en/docs/tutorial/testing.md +++ b/docs/en/docs/tutorial/testing.md @@ -8,6 +8,11 @@ With it, you can use `requests`. + + E.g. `pip install requests`. + Import `TestClient`. Create a `TestClient` by passing your **FastAPI** application to it.