]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Add misc dependency installs to tutorial docs (#2126)
authorTeofilo Zosa <TeoZosa@users.noreply.github.com>
Thu, 18 Aug 2022 20:12:34 +0000 (05:12 +0900)
committerGitHub <noreply@github.com>
Thu, 18 Aug 2022 20:12:34 +0000 (20:12 +0000)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
docs/en/docs/advanced/websockets.md
docs/en/docs/tutorial/response-model.md
docs/en/docs/tutorial/sql-databases.md
docs/en/docs/tutorial/testing.md

index 878ad37ddc31b34e0983b2ef57a66ca43a5dc92f..0e9bc5b06b378cd2dcefa7b0e07cbd892d9babd5 100644 (file)
@@ -2,6 +2,20 @@
 
 You can use <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API" class="external-link" target="_blank">WebSockets</a> with **FastAPI**.
 
+## Install `WebSockets`
+
+First you need to install `WebSockets`:
+
+<div class="termy">
+
+```console
+$ pip install websockets
+
+---> 100%
+```
+
+</div>
+
 ## WebSockets client
 
 ### In production
index e371e86e4abbb19536cdfb6189ec4db14be70c49..2bbd4d4fd5090113daaae048b372d2984f3f29d4 100644 (file)
@@ -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 <a href="https://github.com/JoshData/python-email-validator" class="external-link" target="_blank">`email_validator`</a>.
+
+    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"
index 3436543a5e4f7a5f6882e73a7cee41a152530c27..5ccaf05ecec968f90c4897b72bf829db8dc388f7 100644 (file)
@@ -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`:
+
+<div class="termy">
+
+```console
+$ pip install sqlalchemy
+
+---> 100%
+```
+
+</div>
+
 ## Create the SQLAlchemy parts
 
 Let's refer to the file `sql_app/database.py`.
index fea5a54f5c2de36978f40743c985a070e5c9ee43..79ea2b1ab58b8499c2ce95d05b13ab929e4bb167 100644 (file)
@@ -8,6 +8,11 @@ With it, you can use <a href="https://docs.pytest.org/" class="external-link" ta
 
 ## Using `TestClient`
 
+!!! info
+    To use `TestClient`, first install <a href="https://github.com/psf/requests" class="external-link" target="_blank">`requests`</a>.
+
+    E.g. `pip install requests`.
+
 Import `TestClient`.
 
 Create a `TestClient` by passing your **FastAPI** application to it.