From 17f0ec8927a7a464bd4a0165b2d9d0ad157be12e Mon Sep 17 00:00:00 2001 From: graue70 <23035329+graue70@users.noreply.github.com> Date: Thu, 7 Oct 2021 14:21:34 +0200 Subject: [PATCH 01/46] =?UTF-8?q?=E2=9C=8F=20Fix=20typo=20re-word=20in=20`?= =?UTF-8?q?docs/tutorial/handling-errors.md`=20(#2700)?= 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/tutorial/handling-errors.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/en/docs/tutorial/handling-errors.md b/docs/en/docs/tutorial/handling-errors.md index 4fa82d5d728dd..89f96176d6997 100644 --- a/docs/en/docs/tutorial/handling-errors.md +++ b/docs/en/docs/tutorial/handling-errors.md @@ -260,6 +260,4 @@ You can import and re-use the default exception handlers from `fastapi.exception {!../../../docs_src/handling_errors/tutorial006.py!} ``` -In this example, you are just `print`ing the error with a very expressive message. - -But you get the idea, you can use the exception and then just re-use the default exception handlers. +In this example you are just `print`ing the error with a very expressive message, but you get the idea. You can use the exception and then just re-use the default exception handlers. From 3b686c37746d1134124751b7bb27e7e2368e5213 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 12:22:16 +0000 Subject: [PATCH 02/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 7ce38adc3c19c..5b2c67b371a9f 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ✏ Fix typo re-word in `docs/tutorial/handling-errors.md`. PR [#2700](https://github.com/tiangolo/fastapi/pull/2700) by [@graue70](https://github.com/graue70). * 📝 Add docs for using Trio with Hypercorn. PR [#4014](https://github.com/tiangolo/fastapi/pull/4014) by [@tiangolo](https://github.com/tiangolo). * ➖ Remove `graphene` as an optional dependency. PR [#4007](https://github.com/tiangolo/fastapi/pull/4007) by [@tiangolo](https://github.com/tiangolo). * ✨ Add support for Trio via AnyIO. PR [#3372](https://github.com/tiangolo/fastapi/pull/3372) by [@graingert](https://github.com/graingert). From 8f4e3a4377293e73b93a1703e8a468d623028b97 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Thu, 7 Oct 2021 15:56:57 +0330 Subject: [PATCH 03/46] =?UTF-8?q?=F0=9F=93=9D=20Add=20supported=20Python?= =?UTF-8?q?=20versions=20badge=20(#2794)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- README.md | 3 +++ docs/en/docs/index.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index d376fb74ea78f..b1c815dc71d9c 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ Package version + + Supported Python versions +

--- diff --git a/docs/en/docs/index.md b/docs/en/docs/index.md index cc6982b799b01..aa2c16a2e6d61 100644 --- a/docs/en/docs/index.md +++ b/docs/en/docs/index.md @@ -14,6 +14,9 @@ Package version + + Supported Python versions +

--- From fee3126d3a6f3045a94274caf33f8498f3dd414d Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 12:27:41 +0000 Subject: [PATCH 04/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 5b2c67b371a9f..bff7847ae79af 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 📝 Add supported Python versions badge. PR [#2794](https://github.com/tiangolo/fastapi/pull/2794) by [@hramezani](https://github.com/hramezani). * ✏ Fix typo re-word in `docs/tutorial/handling-errors.md`. PR [#2700](https://github.com/tiangolo/fastapi/pull/2700) by [@graue70](https://github.com/graue70). * 📝 Add docs for using Trio with Hypercorn. PR [#4014](https://github.com/tiangolo/fastapi/pull/4014) by [@tiangolo](https://github.com/tiangolo). * ➖ Remove `graphene` as an optional dependency. PR [#4007](https://github.com/tiangolo/fastapi/pull/4007) by [@tiangolo](https://github.com/tiangolo). From 0ceacef413f2c6378b7f00db87c9c0b59205afbf Mon Sep 17 00:00:00 2001 From: Vijay Yarramsetty <32131775+vijaykumar1356@users.noreply.github.com> Date: Thu, 7 Oct 2021 18:00:25 +0530 Subject: [PATCH 05/46] =?UTF-8?q?=E2=9C=8F=20Fix=20typo=20in=20`docs/en/do?= =?UTF-8?q?cs/tutorial/body-nested-models.md`=20(#2808)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez From 426bd096ad5e4f3f7f3deeaa67106228a3831f00 Mon Sep 17 00:00:00 2001 From: raphaelauv Date: Thu, 7 Oct 2021 14:44:39 +0200 Subject: [PATCH 06/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20note=20about=20Fa?= =?UTF-8?q?lcon=20and=20ASGI,=20as=20now=20Falcon=20is=20also=20ASGI=20?= =?UTF-8?q?=F0=9F=8E=89=20(#3073)?= 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/alternatives.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/en/docs/alternatives.md b/docs/en/docs/alternatives.md index d2792eb0cb613..28d0be8cc0802 100644 --- a/docs/en/docs/alternatives.md +++ b/docs/en/docs/alternatives.md @@ -242,8 +242,6 @@ It was one of the first extremely fast Python frameworks based on `asyncio`. It Falcon is another high performance Python framework, it is designed to be minimal, and work as the foundation of other frameworks like Hug. -It uses the previous standard for Python web frameworks (WSGI) which is synchronous, so it can't handle WebSockets and other use cases. Nevertheless, it also has a very good performance. - It is designed to have functions that receive two parameters, one "request" and one "response". Then you "read" parts from the request, and "write" parts to the response. Because of this design, it is not possible to declare request parameters and bodies with standard Python type hints as function parameters. So, data validation, serialization, and documentation, have to be done in code, not automatically. Or they have to be implemented as a framework on top of Falcon, like Hug. This same distinction happens in other frameworks that are inspired by Falcon's design, of having one request object and one response object as parameters. From afe1f69e792a537b689f7b4733e7149ca123da71 Mon Sep 17 00:00:00 2001 From: Greg Gandenberger Date: Thu, 7 Oct 2021 07:55:51 -0500 Subject: [PATCH 07/46] =?UTF-8?q?=F0=9F=93=9D=20Remove=20note=20about=20(n?= =?UTF-8?q?ow=20supported)=20feature=20from=20Swagger=20UI=20in=20`docs/en?= =?UTF-8?q?/docs/tutorial/request-files.md`=20(#2803)?= 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/tutorial/request-files.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/en/docs/tutorial/request-files.md b/docs/en/docs/tutorial/request-files.md index 1619d6d2a7ec9..68ea654c29d4d 100644 --- a/docs/en/docs/tutorial/request-files.md +++ b/docs/en/docs/tutorial/request-files.md @@ -127,13 +127,6 @@ To use that, declare a `List` of `bytes` or `UploadFile`: You will receive, as declared, a `list` of `bytes` or `UploadFile`s. -!!! note - Notice that, as of 2019-04-14, Swagger UI doesn't support multiple file uploads in the same form field. For more information, check #4276 and #3641. - - Nevertheless, **FastAPI** is already compatible with it, using the standard OpenAPI. - - So, whenever Swagger UI supports multi-file uploads, or any other tools that supports OpenAPI, they will be compatible with **FastAPI**. - !!! note "Technical Details" You could also use `from starlette.responses import HTMLResponse`. From 12db3926b55ce5698b1b837161706ac86db47a03 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 12:57:15 +0000 Subject: [PATCH 08/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index bff7847ae79af..2baee0288667e 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 📝 Remove note about (now supported) feature from Swagger UI in `docs/en/docs/tutorial/request-files.md`. PR [#2803](https://github.com/tiangolo/fastapi/pull/2803) by [@gsganden](https://github.com/gsganden). * 📝 Add supported Python versions badge. PR [#2794](https://github.com/tiangolo/fastapi/pull/2794) by [@hramezani](https://github.com/hramezani). * ✏ Fix typo re-word in `docs/tutorial/handling-errors.md`. PR [#2700](https://github.com/tiangolo/fastapi/pull/2700) by [@graue70](https://github.com/graue70). * 📝 Add docs for using Trio with Hypercorn. PR [#4014](https://github.com/tiangolo/fastapi/pull/4014) by [@tiangolo](https://github.com/tiangolo). From b69781b161509d51095faa98ddd3bc6c78613eb7 Mon Sep 17 00:00:00 2001 From: Abraham Hinteregger Date: Thu, 7 Oct 2021 15:00:33 +0200 Subject: [PATCH 09/46] =?UTF-8?q?=E2=9C=8F=20Fix=20typo=20(mistranslation)?= =?UTF-8?q?=20in=20`docs/en/docs/advanced/templates.md`=20(#3211)?= 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/templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/advanced/templates.md b/docs/en/docs/advanced/templates.md index 45e6a20fc54b3..38618aeeb09cd 100644 --- a/docs/en/docs/advanced/templates.md +++ b/docs/en/docs/advanced/templates.md @@ -2,7 +2,7 @@ You can use any template engine you want with **FastAPI**. -A common election is Jinja2, the same one used by Flask and other tools. +A common choice is Jinja2, the same one used by Flask and other tools. There are utilities to configure it easily that you can use directly in your **FastAPI** application (provided by Starlette). From 3581034eff447366bcffb896c0fc161e2bd23e75 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 13:01:11 +0000 Subject: [PATCH 10/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 2baee0288667e..8ca74f1cdd722 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ✏ Fix typo (mistranslation) in `docs/en/docs/advanced/templates.md`. PR [#3211](https://github.com/tiangolo/fastapi/pull/3211) by [@oerpli](https://github.com/oerpli). * 📝 Remove note about (now supported) feature from Swagger UI in `docs/en/docs/tutorial/request-files.md`. PR [#2803](https://github.com/tiangolo/fastapi/pull/2803) by [@gsganden](https://github.com/gsganden). * 📝 Add supported Python versions badge. PR [#2794](https://github.com/tiangolo/fastapi/pull/2794) by [@hramezani](https://github.com/hramezani). * ✏ Fix typo re-word in `docs/tutorial/handling-errors.md`. PR [#2700](https://github.com/tiangolo/fastapi/pull/2700) by [@graue70](https://github.com/graue70). From e423c8241af70f6fedd5074c161c3befa5af12cf Mon Sep 17 00:00:00 2001 From: mori yuta <59682979+utamori@users.noreply.github.com> Date: Thu, 7 Oct 2021 22:06:17 +0900 Subject: [PATCH 11/46] =?UTF-8?q?=E2=9C=8F=20Fix=20link=20in=20Japanese=20?= =?UTF-8?q?docs=20for=20`docs/ja/docs/deployment/docker.md`=20(#3245)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/ja/docs/deployment/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/docs/deployment/docker.md b/docs/ja/docs/deployment/docker.md index 03a95ac6f173e..f10312b5161c6 100644 --- a/docs/ja/docs/deployment/docker.md +++ b/docs/ja/docs/deployment/docker.md @@ -170,7 +170,7 @@ TraefikおよびHTTPS処理を備えたDocker Swarm Modeクラスターをセッ ### FastAPIアプリケーションのデプロイ -すべてを設定するための最も簡単な方法は、[**FastAPI** Project Generators](project-generation.md){.internal-link target=_blank}を使用することでしょう。 +すべてを設定するための最も簡単な方法は、[**FastAPI** Project Generators](../project-generation.md){.internal-link target=_blank}を使用することでしょう。 上述したTraefikとHTTPSを備えたDocker Swarm クラスタが統合されるように設計されています。 From 46882b9ae15ba0a3c312e556d1e8c8982f00c780 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 13:07:24 +0000 Subject: [PATCH 12/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 8ca74f1cdd722..5fa77c93dc763 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ✏ Fix link in Japanese docs for `docs/ja/docs/deployment/docker.md`. PR [#3245](https://github.com/tiangolo/fastapi/pull/3245) by [@utamori](https://github.com/utamori). * ✏ Fix typo (mistranslation) in `docs/en/docs/advanced/templates.md`. PR [#3211](https://github.com/tiangolo/fastapi/pull/3211) by [@oerpli](https://github.com/oerpli). * 📝 Remove note about (now supported) feature from Swagger UI in `docs/en/docs/tutorial/request-files.md`. PR [#2803](https://github.com/tiangolo/fastapi/pull/2803) by [@gsganden](https://github.com/gsganden). * 📝 Add supported Python versions badge. PR [#2794](https://github.com/tiangolo/fastapi/pull/2794) by [@hramezani](https://github.com/hramezani). From 8e68ddbddfa2c1897e6a9a3f7eeab2ae141f6f4d Mon Sep 17 00:00:00 2001 From: Somraj Saha Date: Thu, 7 Oct 2021 18:43:10 +0530 Subject: [PATCH 13/46] =?UTF-8?q?=F0=9F=93=9D=20Add=20external=20link=20to?= =?UTF-8?q?=20article:=20How-to=20deploy=20FastAPI=20app=20to=20Heroku=20(?= =?UTF-8?q?#3241)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/en/data/external_links.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index 40bf5ef04b9be..bb3e00932bd49 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -1,5 +1,9 @@ articles: english: + - link: https://jarmos.netlify.app/posts/using-github-actions-to-deploy-a-fastapi-project-to-heroku/ + title: Using GitHub Actions to Deploy a FastAPI Project to Heroku + author_link: https://jarmos.netlify.app/ + author: Somraj Saha - author: "@pystar" author_link: https://pystar.substack.com/ link: https://pystar.substack.com/p/how-to-create-a-fake-certificate From 5551e7282ce2b16b88a724082763fa22aeb116de Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 13:14:08 +0000 Subject: [PATCH 14/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 5fa77c93dc763..7891c8a4f620b 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 📝 Add external link to article: How-to deploy FastAPI app to Heroku. PR [#3241](https://github.com/tiangolo/fastapi/pull/3241) by [@Jarmos-san](https://github.com/Jarmos-san). * ✏ Fix link in Japanese docs for `docs/ja/docs/deployment/docker.md`. PR [#3245](https://github.com/tiangolo/fastapi/pull/3245) by [@utamori](https://github.com/utamori). * ✏ Fix typo (mistranslation) in `docs/en/docs/advanced/templates.md`. PR [#3211](https://github.com/tiangolo/fastapi/pull/3211) by [@oerpli](https://github.com/oerpli). * 📝 Remove note about (now supported) feature from Swagger UI in `docs/en/docs/tutorial/request-files.md`. PR [#2803](https://github.com/tiangolo/fastapi/pull/2803) by [@gsganden](https://github.com/gsganden). From c29aa0bc8726e2c4e91ada08e4321062782a3455 Mon Sep 17 00:00:00 2001 From: Edd Salkield Date: Thu, 7 Oct 2021 13:26:36 +0000 Subject: [PATCH 15/46] =?UTF-8?q?=F0=9F=94=A7=20Swap=20light/dark=20theme?= =?UTF-8?q?=20button=20icon=20(#3246)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/az/mkdocs.yml | 4 ++-- docs/de/mkdocs.yml | 4 ++-- docs/en/mkdocs.yml | 4 ++-- docs/es/mkdocs.yml | 4 ++-- docs/fr/mkdocs.yml | 4 ++-- docs/id/mkdocs.yml | 4 ++-- docs/it/mkdocs.yml | 4 ++-- docs/ja/mkdocs.yml | 4 ++-- docs/ko/mkdocs.yml | 4 ++-- docs/pl/mkdocs.yml | 4 ++-- docs/pt/mkdocs.yml | 4 ++-- docs/ru/mkdocs.yml | 4 ++-- docs/sq/mkdocs.yml | 4 ++-- docs/tr/mkdocs.yml | 4 ++-- docs/uk/mkdocs.yml | 4 ++-- docs/zh/mkdocs.yml | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/az/mkdocs.yml b/docs/az/mkdocs.yml index edeb6c2e37a8e..72ca92a96766e 100644 --- a/docs/az/mkdocs.yml +++ b/docs/az/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/de/mkdocs.yml b/docs/de/mkdocs.yml index bcd521c805fea..621305d208b35 100644 --- a/docs/de/mkdocs.yml +++ b/docs/de/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/en/mkdocs.yml b/docs/en/mkdocs.yml index 28a688a963d3c..aa2d0451d1643 100644 --- a/docs/en/mkdocs.yml +++ b/docs/en/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/es/mkdocs.yml b/docs/es/mkdocs.yml index 35127ac2714a7..ef722715b5c42 100644 --- a/docs/es/mkdocs.yml +++ b/docs/es/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml index 4cd0750c92ed2..940e4ff6980a8 100644 --- a/docs/fr/mkdocs.yml +++ b/docs/fr/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/id/mkdocs.yml b/docs/id/mkdocs.yml index 31488ee33a009..f9cae22cc6449 100644 --- a/docs/id/mkdocs.yml +++ b/docs/id/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/it/mkdocs.yml b/docs/it/mkdocs.yml index 10e6198f26dc3..f162106081514 100644 --- a/docs/it/mkdocs.yml +++ b/docs/it/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/ja/mkdocs.yml b/docs/ja/mkdocs.yml index 37f6548d8c9e3..237bc96540301 100644 --- a/docs/ja/mkdocs.yml +++ b/docs/ja/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/ko/mkdocs.yml b/docs/ko/mkdocs.yml index bb66c8987ac88..0bf1a97136fad 100644 --- a/docs/ko/mkdocs.yml +++ b/docs/ko/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/pl/mkdocs.yml b/docs/pl/mkdocs.yml index 0775048e9f5b3..220008607a4e1 100644 --- a/docs/pl/mkdocs.yml +++ b/docs/pl/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index 3e5fece58be4f..219f41b81c573 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/ru/mkdocs.yml b/docs/ru/mkdocs.yml index eee98a9bc0b7a..e15a36bf2894c 100644 --- a/docs/ru/mkdocs.yml +++ b/docs/ru/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/sq/mkdocs.yml b/docs/sq/mkdocs.yml index 1d2adbb7dcf94..a4879521eb2ce 100644 --- a/docs/sq/mkdocs.yml +++ b/docs/sq/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/tr/mkdocs.yml b/docs/tr/mkdocs.yml index d78947fa72da8..6fe2b0b626c75 100644 --- a/docs/tr/mkdocs.yml +++ b/docs/tr/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/uk/mkdocs.yml b/docs/uk/mkdocs.yml index 41aec880cad96..7f5785e3eccb0 100644 --- a/docs/uk/mkdocs.yml +++ b/docs/uk/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index 3f27884e4c1bd..07ffa367f8d8e 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -9,13 +9,13 @@ theme: primary: teal accent: amber toggle: - icon: material/lightbulb-outline + icon: material/lightbulb name: Switch to light mode - scheme: slate primary: teal accent: amber toggle: - icon: material/lightbulb + icon: material/lightbulb-outline name: Switch to dark mode features: - search.suggest From b67532ee5ca6af6d1ae048b60e59d8cf36b5783d Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 13:27:16 +0000 Subject: [PATCH 16/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 7891c8a4f620b..0a54f5356dfbb 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🔧 Swap light/dark theme button icon. PR [#3246](https://github.com/tiangolo/fastapi/pull/3246) by [@eddsalkield](https://github.com/eddsalkield). * 📝 Add external link to article: How-to deploy FastAPI app to Heroku. PR [#3241](https://github.com/tiangolo/fastapi/pull/3241) by [@Jarmos-san](https://github.com/Jarmos-san). * ✏ Fix link in Japanese docs for `docs/ja/docs/deployment/docker.md`. PR [#3245](https://github.com/tiangolo/fastapi/pull/3245) by [@utamori](https://github.com/utamori). * ✏ Fix typo (mistranslation) in `docs/en/docs/advanced/templates.md`. PR [#3211](https://github.com/tiangolo/fastapi/pull/3211) by [@oerpli](https://github.com/oerpli). From 4f168c5ada33c2b02344f0a4c7d8d9983fa981a1 Mon Sep 17 00:00:00 2001 From: Pax <13646646+paxcodes@users.noreply.github.com> Date: Thu, 7 Oct 2021 06:32:14 -0700 Subject: [PATCH 17/46] =?UTF-8?q?=F0=9F=93=9D=20=20Fix=20incorrect=20highl?= =?UTF-8?q?ighted=20code=20(#3325)?= 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/tutorial/body-multiple-params.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/tutorial/body-multiple-params.md b/docs/en/docs/tutorial/body-multiple-params.md index 1bc8f14366532..a4484147f50c7 100644 --- a/docs/en/docs/tutorial/body-multiple-params.md +++ b/docs/en/docs/tutorial/body-multiple-params.md @@ -109,7 +109,7 @@ q: Optional[str] = None as in: -```Python hl_lines="27" +```Python hl_lines="28" {!../../../docs_src/body_multiple_params/tutorial004.py!} ``` From 1a8284725aa8c62d347aeb0c37c09aa889a7336b Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 13:32:54 +0000 Subject: [PATCH 18/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 0a54f5356dfbb..74fc37673bed4 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 📝 Fix incorrect highlighted code. PR [#3325](https://github.com/tiangolo/fastapi/pull/3325) by [@paxcodes](https://github.com/paxcodes). * 🔧 Swap light/dark theme button icon. PR [#3246](https://github.com/tiangolo/fastapi/pull/3246) by [@eddsalkield](https://github.com/eddsalkield). * 📝 Add external link to article: How-to deploy FastAPI app to Heroku. PR [#3241](https://github.com/tiangolo/fastapi/pull/3241) by [@Jarmos-san](https://github.com/Jarmos-san). * ✏ Fix link in Japanese docs for `docs/ja/docs/deployment/docker.md`. PR [#3245](https://github.com/tiangolo/fastapi/pull/3245) by [@utamori](https://github.com/utamori). From d06b4d7bb88156bf101f4106b3ddecbd9867ef82 Mon Sep 17 00:00:00 2001 From: Bharat Raghunathan Date: Thu, 7 Oct 2021 19:27:51 +0530 Subject: [PATCH 19/46] =?UTF-8?q?=E2=9C=8F=20Re-word=20to=20clarify=20test?= =?UTF-8?q?=20client=20in=20`docs/en/docs/tutorial/testing.md`=20(#3382)?= 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/tutorial/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/tutorial/testing.md b/docs/en/docs/tutorial/testing.md index b225dcb666667..9c9a8270cc3d2 100644 --- a/docs/en/docs/tutorial/testing.md +++ b/docs/en/docs/tutorial/testing.md @@ -10,7 +10,7 @@ With it, you can use Date: Thu, 7 Oct 2021 13:59:14 +0000 Subject: [PATCH 20/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 74fc37673bed4..e75d8dce720d2 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ✏ Re-word to clarify test client in `docs/en/docs/tutorial/testing.md`. PR [#3382](https://github.com/tiangolo/fastapi/pull/3382) by [@Bharat123rox](https://github.com/Bharat123rox). * 📝 Fix incorrect highlighted code. PR [#3325](https://github.com/tiangolo/fastapi/pull/3325) by [@paxcodes](https://github.com/paxcodes). * 🔧 Swap light/dark theme button icon. PR [#3246](https://github.com/tiangolo/fastapi/pull/3246) by [@eddsalkield](https://github.com/eddsalkield). * 📝 Add external link to article: How-to deploy FastAPI app to Heroku. PR [#3241](https://github.com/tiangolo/fastapi/pull/3241) by [@Jarmos-san](https://github.com/Jarmos-san). From 7efdc110759a318775599d22c34c9a1de2e4e13e Mon Sep 17 00:00:00 2001 From: Denys Marichev Date: Thu, 7 Oct 2021 17:07:46 +0300 Subject: [PATCH 21/46] =?UTF-8?q?=E2=9C=8F=20Fix=20typo=20about=20file=20p?= =?UTF-8?q?ath=20in=20`docs/en/docs/tutorial/bigger-applications.md`=20(#3?= =?UTF-8?q?285)?= 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/tutorial/bigger-applications.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/tutorial/bigger-applications.md b/docs/en/docs/tutorial/bigger-applications.md index 2796d7fb19bcd..2a2e764b5988d 100644 --- a/docs/en/docs/tutorial/bigger-applications.md +++ b/docs/en/docs/tutorial/bigger-applications.md @@ -234,7 +234,7 @@ mean: * Starting in the same package that this module (the file `app/routers/items.py`) lives in (the directory `app/routers/`)... * go to the parent package (the directory `app/`)... -* and in there, find the module `dependencies` (the file at `app/routers/dependencies.py`)... +* and in there, find the module `dependencies` (the file at `app/dependencies.py`)... * and from it, import the function `get_token_header`. That works correctly! 🎉 @@ -252,7 +252,7 @@ that would mean: * Starting in the same package that this module (the file `app/routers/items.py`) lives in (the directory `app/routers/`)... * go to the parent package (the directory `app/`)... * then go to the parent of that package (there's no parent package, `app` is the top level 😱)... -* and in there, find the module `dependencies` (the file at `app/routers/dependencies.py`)... +* and in there, find the module `dependencies` (the file at `app/dependencies.py`)... * and from it, import the function `get_token_header`. That would refer to some package above `app/`, with its own file `__init__.py`, etc. But we don't have that. So, that would throw an error in our example. 🚨 From 4093c350587c899760399f48434b313e4005f2b9 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 14:09:05 +0000 Subject: [PATCH 22/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index e75d8dce720d2..b38431ca00a70 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ✏ Fix typo about file path in `docs/en/docs/tutorial/bigger-applications.md`. PR [#3285](https://github.com/tiangolo/fastapi/pull/3285) by [@HolyDorus](https://github.com/HolyDorus). * ✏ Re-word to clarify test client in `docs/en/docs/tutorial/testing.md`. PR [#3382](https://github.com/tiangolo/fastapi/pull/3382) by [@Bharat123rox](https://github.com/Bharat123rox). * 📝 Fix incorrect highlighted code. PR [#3325](https://github.com/tiangolo/fastapi/pull/3325) by [@paxcodes](https://github.com/paxcodes). * 🔧 Swap light/dark theme button icon. PR [#3246](https://github.com/tiangolo/fastapi/pull/3246) by [@eddsalkield](https://github.com/eddsalkield). From 5a28f95a93802161967b7ad56fb557b434853134 Mon Sep 17 00:00:00 2001 From: jaystone776 Date: Thu, 7 Oct 2021 22:22:16 +0800 Subject: [PATCH 23/46] =?UTF-8?q?=E2=9C=8F=20Fix=20typo=20in=20`docs/en/do?= =?UTF-8?q?cs/help-fastapi.md`=20(#3760)?= 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/help-fastapi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/help-fastapi.md b/docs/en/docs/help-fastapi.md index 394bccab73e2a..8d8d708ed902e 100644 --- a/docs/en/docs/help-fastapi.md +++ b/docs/en/docs/help-fastapi.md @@ -121,7 +121,7 @@ Have in mind that as chats allow more "free conversation", it's easy to ask ques In GitHub issues the template will guide you to write the right question so that you can more easily get a good answer, or even solve the problem yourself even before asking. And in GitHub I can make sure I always answer everything, even if it takes some time. I can't personally do that with the chat systems. 😅 -Conversations in the chat systems are also not as easily searchable as in GitHub, so questions and answers might get lost in the conversation. And only the ones in GitHub issues count to become a [FastAPI Expert](fastapi-people.md#experts){.internal-link target=_blank}, so you will most probably receive more attention in GitHub isssues. +Conversations in the chat systems are also not as easily searchable as in GitHub, so questions and answers might get lost in the conversation. And only the ones in GitHub issues count to become a [FastAPI Expert](fastapi-people.md#experts){.internal-link target=_blank}, so you will most probably receive more attention in GitHub issues. On the other side, there are thousands of users in the chat systems, so there's a high chance you'll find someone to talk to there, almost all the time. 😄 From eb453a50b81f4fe5132b737d5fe07ba78c995beb Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 14:23:26 +0000 Subject: [PATCH 24/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index b38431ca00a70..8a5cbcec7bfe7 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ✏ Fix typo in `docs/en/docs/help-fastapi.md`. PR [#3760](https://github.com/tiangolo/fastapi/pull/3760) by [@jaystone776](https://github.com/jaystone776). * ✏ Fix typo about file path in `docs/en/docs/tutorial/bigger-applications.md`. PR [#3285](https://github.com/tiangolo/fastapi/pull/3285) by [@HolyDorus](https://github.com/HolyDorus). * ✏ Re-word to clarify test client in `docs/en/docs/tutorial/testing.md`. PR [#3382](https://github.com/tiangolo/fastapi/pull/3382) by [@Bharat123rox](https://github.com/Bharat123rox). * 📝 Fix incorrect highlighted code. PR [#3325](https://github.com/tiangolo/fastapi/pull/3325) by [@paxcodes](https://github.com/paxcodes). From e43f43444829ad8e469f2178e473f4b95085c891 Mon Sep 17 00:00:00 2001 From: Jorge Alvarado <65737950+jalvaradosegura@users.noreply.github.com> Date: Thu, 7 Oct 2021 11:36:43 -0300 Subject: [PATCH 25/46] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Add=20a=20missing=20?= =?UTF-8?q?comma=20in=20the=20security=20tutorial=20(#3564)?= 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/tutorial/security/get-current-user.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/tutorial/security/get-current-user.md b/docs/en/docs/tutorial/security/get-current-user.md index f50b69acf0228..a41db2b67d137 100644 --- a/docs/en/docs/tutorial/security/get-current-user.md +++ b/docs/en/docs/tutorial/security/get-current-user.md @@ -84,7 +84,7 @@ Just use any kind of model, any kind of class, any kind of database that you nee ## Code size -This example might seem verbose. Have in mind that we are mixing security, data models utility functions and *path operations* in the same file. +This example might seem verbose. Have in mind that we are mixing security, data models, utility functions and *path operations* in the same file. But here's the key point. From ffaecddbf6b88badce1f08066a1a25b0200e02eb Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 14:37:59 +0000 Subject: [PATCH 26/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 8a5cbcec7bfe7..ffaf4009e605d 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ✏️ Add a missing comma in the security tutorial. PR [#3564](https://github.com/tiangolo/fastapi/pull/3564) by [@jalvaradosegura](https://github.com/jalvaradosegura). * ✏ Fix typo in `docs/en/docs/help-fastapi.md`. PR [#3760](https://github.com/tiangolo/fastapi/pull/3760) by [@jaystone776](https://github.com/jaystone776). * ✏ Fix typo about file path in `docs/en/docs/tutorial/bigger-applications.md`. PR [#3285](https://github.com/tiangolo/fastapi/pull/3285) by [@HolyDorus](https://github.com/HolyDorus). * ✏ Re-word to clarify test client in `docs/en/docs/tutorial/testing.md`. PR [#3382](https://github.com/tiangolo/fastapi/pull/3382) by [@Bharat123rox](https://github.com/Bharat123rox). From 7e4887ea55f932e7373a27354d5a6b7cc3fa9017 Mon Sep 17 00:00:00 2001 From: SaintMalik <37118134+saintmalik@users.noreply.github.com> Date: Thu, 7 Oct 2021 16:29:50 +0100 Subject: [PATCH 27/46] =?UTF-8?q?=E2=9C=8F=20Fix=20a=20typo=20in=20`docs/e?= =?UTF-8?q?n/docs/advanced/path-operation-advanced-configuration.md`=20and?= =?UTF-8?q?=20`docs/en/docs/release-notes.md`=20(#3750)?= 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/path-operation-advanced-configuration.md | 2 +- docs/en/docs/release-notes.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/advanced/path-operation-advanced-configuration.md b/docs/en/docs/advanced/path-operation-advanced-configuration.md index 352fe0764ec57..a1c902ef2ccbb 100644 --- a/docs/en/docs/advanced/path-operation-advanced-configuration.md +++ b/docs/en/docs/advanced/path-operation-advanced-configuration.md @@ -77,7 +77,7 @@ This *path operation*-specific OpenAPI schema is normally generated automaticall !!! tip This is a low level extension point. - If you only need to declare additonal responses, a more convenient way to do it is with [Additional Responses in OpenAPI](./additional-responses.md){.internal-link target=_blank}. + If you only need to declare additional responses, a more convenient way to do it is with [Additional Responses in OpenAPI](./additional-responses.md){.internal-link target=_blank}. You can extend the OpenAPI schema for a *path operation* using the parameter `openapi_extra`. diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index ffaf4009e605d..03234188f0516 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -94,7 +94,7 @@ Soon there will be a new FastAPI release upgrading Starlette to take advantage o ### Features * ✨ Add support for extensions and updates to the OpenAPI schema in each *path operation*. New docs: [FastAPI Path Operation Advanced Configuration - OpenAPI Extra](https://fastapi.tiangolo.com/advanced/path-operation-advanced-configuration/#openapi-extra). Initial PR [#1922](https://github.com/tiangolo/fastapi/pull/1922) by [@edouardlp](https://github.com/edouardlp). -* ✨ Add additonal OpenAPI metadata parameters to `FastAPI` class, shown on the automatic API docs UI. New docs: [Metadata and Docs URLs](https://fastapi.tiangolo.com/tutorial/metadata/). Initial PR [#1812](https://github.com/tiangolo/fastapi/pull/1812) by [@dkreeft](https://github.com/dkreeft). +* ✨ Add additional OpenAPI metadata parameters to `FastAPI` class, shown on the automatic API docs UI. New docs: [Metadata and Docs URLs](https://fastapi.tiangolo.com/tutorial/metadata/). Initial PR [#1812](https://github.com/tiangolo/fastapi/pull/1812) by [@dkreeft](https://github.com/dkreeft). * ✨ Add `description` parameter to all the security scheme classes, e.g. `APIKeyQuery(name="key", description="A very cool API key")`. PR [#1757](https://github.com/tiangolo/fastapi/pull/1757) by [@hylkepostma](https://github.com/hylkepostma). * ✨ Update OpenAPI models, supporting recursive models and extensions. PR [#3628](https://github.com/tiangolo/fastapi/pull/3628) by [@tiangolo](https://github.com/tiangolo). * ✨ Import and re-export data structures from Starlette, used by Request properties, on `fastapi.datastructures`. Initial PR [#1872](https://github.com/tiangolo/fastapi/pull/1872) by [@jamescurtin](https://github.com/jamescurtin). From bb20f5e60df2384663e94d5abe4f8e67bb7a16a3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 15:30:34 +0000 Subject: [PATCH 28/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 03234188f0516..6371d48ad818b 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ✏ Fix a typo in `docs/en/docs/advanced/path-operation-advanced-configuration.md` and `docs/en/docs/release-notes.md`. PR [#3750](https://github.com/tiangolo/fastapi/pull/3750) by [@saintmalik](https://github.com/saintmalik). * ✏️ Add a missing comma in the security tutorial. PR [#3564](https://github.com/tiangolo/fastapi/pull/3564) by [@jalvaradosegura](https://github.com/jalvaradosegura). * ✏ Fix typo in `docs/en/docs/help-fastapi.md`. PR [#3760](https://github.com/tiangolo/fastapi/pull/3760) by [@jaystone776](https://github.com/jaystone776). * ✏ Fix typo about file path in `docs/en/docs/tutorial/bigger-applications.md`. PR [#3285](https://github.com/tiangolo/fastapi/pull/3285) by [@HolyDorus](https://github.com/HolyDorus). From b1508dcacc3ebc0001949156b8460c5327bb2f53 Mon Sep 17 00:00:00 2001 From: Jorge Alvarado <65737950+jalvaradosegura@users.noreply.github.com> Date: Thu, 7 Oct 2021 12:39:19 -0300 Subject: [PATCH 29/46] =?UTF-8?q?=E2=9C=8F=20Re-word=20and=20combine=202?= =?UTF-8?q?=20paragraphs=20into=201=20for=20readability=20(#3346)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/es/docs/tutorial/index.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/es/docs/tutorial/index.md b/docs/es/docs/tutorial/index.md index 14ce392253637..9cbdb272759d2 100644 --- a/docs/es/docs/tutorial/index.md +++ b/docs/es/docs/tutorial/index.md @@ -4,9 +4,7 @@ Este tutorial te muestra cómo usar **FastAPI** con la mayoría de sus caracter Cada sección se basa gradualmente en las anteriores, pero está estructurada en temas separados, así puedes ir directamente a cualquier tema en concreto para resolver tus necesidades específicas sobre la API. -También está diseñado para funcionar como una referencia futura. - -Para que puedas volver y ver exactamente lo que necesitas. +Funciona también como una referencia futura, para que puedas volver y ver exactamente lo que necesitas. ## Ejecuta el código From 4ba1e81f1671ae252b514fed31f76f2224144df4 Mon Sep 17 00:00:00 2001 From: Nina Hwang <79563565+NinaHwang@users.noreply.github.com> Date: Fri, 8 Oct 2021 00:44:46 +0900 Subject: [PATCH 30/46] =?UTF-8?q?=E2=9C=8F=20Fix=20typo=20in=20file=20path?= =?UTF-8?q?s=20in=20`docs/en/docs/contributing.md`=20(#3752)?= 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/contributing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/contributing.md b/docs/en/docs/contributing.md index 9ef6e22c84395..648c472fea964 100644 --- a/docs/en/docs/contributing.md +++ b/docs/en/docs/contributing.md @@ -326,7 +326,7 @@ docs/es/docs/features.md * Now open the MkDocs config file for English at: ``` -docs/en/docs/mkdocs.yml +docs/en/mkdocs.yml ``` * Find the place where that `docs/features.md` is located in the config file. Somewhere like: @@ -345,7 +345,7 @@ nav: * Open the MkDocs config file for the language you are editing, e.g.: ``` -docs/es/docs/mkdocs.yml +docs/es/mkdocs.yml ``` * Add it there at the exact same location it was for English, e.g.: From d198f38b4546d62b7cf30c3eae0affb4a429167a Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 15:45:28 +0000 Subject: [PATCH 31/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 6371d48ad818b..f5729765ea846 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ✏ Fix typo in file paths in `docs/en/docs/contributing.md`. PR [#3752](https://github.com/tiangolo/fastapi/pull/3752) by [@NinaHwang](https://github.com/NinaHwang). * ✏ Fix a typo in `docs/en/docs/advanced/path-operation-advanced-configuration.md` and `docs/en/docs/release-notes.md`. PR [#3750](https://github.com/tiangolo/fastapi/pull/3750) by [@saintmalik](https://github.com/saintmalik). * ✏️ Add a missing comma in the security tutorial. PR [#3564](https://github.com/tiangolo/fastapi/pull/3564) by [@jalvaradosegura](https://github.com/jalvaradosegura). * ✏ Fix typo in `docs/en/docs/help-fastapi.md`. PR [#3760](https://github.com/tiangolo/fastapi/pull/3760) by [@jaystone776](https://github.com/jaystone776). From 9c6e0d02bb8e3de31ca26ee4118119e928eb099f Mon Sep 17 00:00:00 2001 From: Kaustubh Gupta Date: Thu, 7 Oct 2021 21:25:40 +0530 Subject: [PATCH 32/46] =?UTF-8?q?=F0=9F=93=9D=20Add=20external=20link=20to?= =?UTF-8?q?=20article:=20Deploying=20ML=20Models=20as=20API=20Using=20Fast?= =?UTF-8?q?API=20and=20Heroku=20(#3904)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/en/data/external_links.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index bb3e00932bd49..0850d9788507d 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -1,5 +1,9 @@ articles: english: + - author: Kaustubh Gupta + author_link: https://medium.com/@kaustubhgupta1828/ + link: https://www.analyticsvidhya.com/blog/2021/06/deploying-ml-models-as-api-using-fastapi-and-heroku/ + title: Deploying ML Models as API Using FastAPI and Heroku - link: https://jarmos.netlify.app/posts/using-github-actions-to-deploy-a-fastapi-project-to-heroku/ title: Using GitHub Actions to Deploy a FastAPI Project to Heroku author_link: https://jarmos.netlify.app/ From 077e5baf2c277ae49b56a5d4e913fbbc29c3cd03 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 15:56:18 +0000 Subject: [PATCH 33/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index f5729765ea846..0654d80700a23 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 📝 Add external link to article: Deploying ML Models as API Using FastAPI and Heroku. PR [#3904](https://github.com/tiangolo/fastapi/pull/3904) by [@kaustubhgupta](https://github.com/kaustubhgupta). * ✏ Fix typo in file paths in `docs/en/docs/contributing.md`. PR [#3752](https://github.com/tiangolo/fastapi/pull/3752) by [@NinaHwang](https://github.com/NinaHwang). * ✏ Fix a typo in `docs/en/docs/advanced/path-operation-advanced-configuration.md` and `docs/en/docs/release-notes.md`. PR [#3750](https://github.com/tiangolo/fastapi/pull/3750) by [@saintmalik](https://github.com/saintmalik). * ✏️ Add a missing comma in the security tutorial. PR [#3564](https://github.com/tiangolo/fastapi/pull/3564) by [@jalvaradosegura](https://github.com/jalvaradosegura). From c54fb7e20804698bf9ba9422fd92e53fa85114ad Mon Sep 17 00:00:00 2001 From: tomwei7 Date: Thu, 7 Oct 2021 23:57:38 +0800 Subject: [PATCH 34/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20docs=20with=20pip?= =?UTF-8?q?=20install=20calls=20when=20using=20extras=20with=20brackets,?= =?UTF-8?q?=20use=20quotes=20for=20compatibility=20with=20Zsh=20(#3131)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- README.md | 4 ++-- docs/en/docs/deployment/manually.md | 2 +- docs/en/docs/deployment/server-workers.md | 2 +- docs/en/docs/index.md | 4 ++-- docs/en/docs/tutorial/index.md | 4 ++-- docs/en/docs/tutorial/security/oauth2-jwt.md | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b1c815dc71d9c..8300315817254 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ You will also need an ASGI server, for production such as ```console -$ pip install uvicorn[standard] +$ pip install "uvicorn[standard]" ---> 100% ``` @@ -456,7 +456,7 @@ Used by FastAPI / Starlette: * uvicorn - for the server that loads and serves your application. * orjson - Required if you want to use `ORJSONResponse`. -You can install all of these with `pip install fastapi[all]`. +You can install all of these with `pip install "fastapi[all]"`. ## License diff --git a/docs/en/docs/deployment/manually.md b/docs/en/docs/deployment/manually.md index 6a3619b65a196..7fd1f4d4f2f96 100644 --- a/docs/en/docs/deployment/manually.md +++ b/docs/en/docs/deployment/manually.md @@ -29,7 +29,7 @@ You can install an ASGI compatible server with:
```console - $ pip install uvicorn[standard] + $ pip install "uvicorn[standard]" ---> 100% ``` diff --git a/docs/en/docs/deployment/server-workers.md b/docs/en/docs/deployment/server-workers.md index 2892d5797e5f9..84a2b0f33f7a2 100644 --- a/docs/en/docs/deployment/server-workers.md +++ b/docs/en/docs/deployment/server-workers.md @@ -39,7 +39,7 @@ And then the Gunicorn-compatible **Uvicorn worker** class would be in charge of
```console -$ pip install uvicorn[standard] gunicorn +$ pip install "uvicorn[standard]" gunicorn ---> 100% ``` diff --git a/docs/en/docs/index.md b/docs/en/docs/index.md index aa2c16a2e6d61..7de1e50df5627 100644 --- a/docs/en/docs/index.md +++ b/docs/en/docs/index.md @@ -134,7 +134,7 @@ You will also need an ASGI server, for production such as ```console -$ pip install uvicorn[standard] +$ pip install "uvicorn[standard]" ---> 100% ``` @@ -457,7 +457,7 @@ Used by FastAPI / Starlette: * uvicorn - for the server that loads and serves your application. * orjson - Required if you want to use `ORJSONResponse`. -You can install all of these with `pip install fastapi[all]`. +You can install all of these with `pip install "fastapi[all]"`. ## License diff --git a/docs/en/docs/tutorial/index.md b/docs/en/docs/tutorial/index.md index bd02cd53935d3..8b4a9df9be8cc 100644 --- a/docs/en/docs/tutorial/index.md +++ b/docs/en/docs/tutorial/index.md @@ -43,7 +43,7 @@ For the tutorial, you might want to install it with all the optional dependencie
```console -$ pip install fastapi[all] +$ pip install "fastapi[all]" ---> 100% ``` @@ -64,7 +64,7 @@ $ pip install fastapi[all] Also install `uvicorn` to work as the server: ``` - pip install uvicorn[standard] + pip install "uvicorn[standard]" ``` And the same for each of the optional dependencies that you want to use. diff --git a/docs/en/docs/tutorial/security/oauth2-jwt.md b/docs/en/docs/tutorial/security/oauth2-jwt.md index fda722cd10db5..f88cf23c0e5ad 100644 --- a/docs/en/docs/tutorial/security/oauth2-jwt.md +++ b/docs/en/docs/tutorial/security/oauth2-jwt.md @@ -33,7 +33,7 @@ We need to install `python-jose` to generate and verify the JWT tokens in Python
```console -$ pip install python-jose[cryptography] +$ pip install "python-jose[cryptography]" ---> 100% ``` @@ -76,7 +76,7 @@ So, install PassLib with Bcrypt:
```console -$ pip install passlib[bcrypt] +$ pip install "passlib[bcrypt]" ---> 100% ``` From eb89968b360cebcd0a9add92c5fc336aa7c44935 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Oct 2021 15:58:17 +0000 Subject: [PATCH 35/46] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 0654d80700a23..6efceb39062cd 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 📝 Update docs with pip install calls when using extras with brackets, use quotes for compatibility with Zsh. PR [#3131](https://github.com/tiangolo/fastapi/pull/3131) by [@tomwei7](https://github.com/tomwei7). * 📝 Add external link to article: Deploying ML Models as API Using FastAPI and Heroku. PR [#3904](https://github.com/tiangolo/fastapi/pull/3904) by [@kaustubhgupta](https://github.com/kaustubhgupta). * ✏ Fix typo in file paths in `docs/en/docs/contributing.md`. PR [#3752](https://github.com/tiangolo/fastapi/pull/3752) by [@NinaHwang](https://github.com/NinaHwang). * ✏ Fix a typo in `docs/en/docs/advanced/path-operation-advanced-configuration.md` and `docs/en/docs/release-notes.md`. PR [#3750](https://github.com/tiangolo/fastapi/pull/3750) by [@saintmalik](https://github.com/saintmalik). From 53076170c01ad9daff3060ae6c8fdf62772c1b82 Mon Sep 17 00:00:00 2001 From: Andy Challis Date: Fri, 8 Oct 2021 03:14:39 +1100 Subject: [PATCH 36/46] =?UTF-8?q?=E2=9C=8F=20Fix=20typos=20in=20Deployment?= =?UTF-8?q?=20Guide=20(#3975)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Anthony Lukach Co-authored-by: Sebastián Ramírez --- docs/en/docs/deployment/concepts.md | 34 +++++++++++------------ docs/en/docs/deployment/deta.md | 8 +++--- docs/en/docs/deployment/docker.md | 18 ++++++------ docs/en/docs/deployment/https.md | 2 +- docs/en/docs/deployment/index.md | 2 +- docs/en/docs/deployment/server-workers.md | 6 ++-- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/en/docs/deployment/concepts.md b/docs/en/docs/deployment/concepts.md index d22b53fe048f4..22604ceeb234f 100644 --- a/docs/en/docs/deployment/concepts.md +++ b/docs/en/docs/deployment/concepts.md @@ -21,7 +21,7 @@ By considering these concepts, you will be able to **evaluate and design** the b In the next chapters, I'll give you more **concrete recipes** to deploy FastAPI applications. -But for now, let's check these important **conceptual ideas**. These concepts also apply for any other type of web API. 💡 +But for now, let's check these important **conceptual ideas**. These concepts also apply to any other type of web API. 💡 ## Security - HTTPS @@ -47,7 +47,7 @@ Some of the tools you could use as a TLS Termination Proxy are: * With an external component like cert-manager for certificate renewals * Handled internally by a cloud provider as part of their services (read below 👇) -Another option is that you could use a **cloud service** that does more of the work including setting up HTTPS. It could have some restrictions or charge you more, etc. But in that case you wouldn't have to set up a TLS Termination Proxy yourself. +Another option is that you could use a **cloud service** that does more of the work including setting up HTTPS. It could have some restrictions or charge you more, etc. But in that case, you wouldn't have to set up a TLS Termination Proxy yourself. I'll show you some concrete examples in the next chapters. @@ -64,7 +64,7 @@ We will talk a lot about the running "**process**", so it's useful to have clari The word **program** is commonly used to describe many things: * The **code** that you write, the **Python files**. -* The **file** that can be **executed** by the operating system, for example `python`, `python.exe` or `uvicorn`. +* The **file** that can be **executed** by the operating system, for example: `python`, `python.exe` or `uvicorn`. * A particular program while it is **running** on the operating system, using the CPU, and storing things on memory. This is also called a **process**. ### What is a Process @@ -75,7 +75,7 @@ The word **process** is normally used in a more specific way, only referring to * This doesn't refer to the file, nor to the code, it refers **specifically** to the thing that is being **executed** and managed by the operating system. * Any program, any code, **can only do things** when it is being **executed**. So, when there's a **process running**. * The process can be **terminated** (or "killed") by you, or by the operating system. At that point, it stops running/being executed, and it can **no longer do things**. -* Each application that you have running in your computer has some process behind it, each running program, each window, etc. And there are normally many processes running **at the same time** while a computer is on. +* Each application that you have running on your computer has some process behind it, each running program, each window, etc. And there are normally many processes running **at the same time** while a computer is on. * There can be **multiple processes** of the **same program** running at the same time. If you check out the "task manager" or "system monitor" (or similar tools) in your operating system, you will be able to see many of those processes running. @@ -90,13 +90,13 @@ Now that we know the difference between the terms **process** and **program**, l ## Running on Startup -In most cases, when you create a web API, you want it to be **always running**, uninterrupted, so that your clients can always access it. This is of course, unless you have a specific reason why you want it to run only on certain situations, but most of the time you want it constantly running and **available**. +In most cases, when you create a web API, you want it to be **always running**, uninterrupted, so that your clients can always access it. This is of course, unless you have a specific reason why you want it to run only in certain situations, but most of the time you want it constantly running and **available**. ### In a Remote Server When you set up a remote server (a cloud server, a virtual machine, etc.) the simplest thing you can do is to run Uvicorn (or similar) manually, the same way you do when developing locally. -And it will work, and will be useful **during development**. +And it will work and will be useful **during development**. But if your connection to the server is lost, the **running process** will probably die. @@ -108,7 +108,7 @@ In general, you will probably want the server program (e.g. Uvicorn) to be start ### Separate Program -To achieve this, you will normally have a **separate program** that would make sure your application is run on startup. And in many cases it would also make sure other components or applications are also run, for example a database. +To achieve this, you will normally have a **separate program** that would make sure your application is run on startup. And in many cases, it would also make sure other components or applications are also run, for example, a database. ### Example Tools to Run at Startup @@ -177,7 +177,7 @@ For example, this could be handled by: With a FastAPI application, using a server program like Uvicorn, running it once in **one process** can serve multiple clients concurrently. -But in many cases you will want to run several worker processes at the same time. +But in many cases, you will want to run several worker processes at the same time. ### Multiple Processes - Workers @@ -197,11 +197,11 @@ So, to be able to have **multiple processes** at the same time, there has to be Now, when the program loads things in memory, for example, a machine learning model in a variable, or the contents of a large file in a variable, all that **consumes a bit of the memory (RAM)** of the server. -And multiple processes normally **don't share any memory**. This means that each running process has its own things, its own variables, its own memory. And if you are consuming a large amount of memory in your code, **each process** will consume an equivalent amount of memory. +And multiple processes normally **don't share any memory**. This means that each running process has its own things, variables, and memory. And if you are consuming a large amount of memory in your code, **each process** will consume an equivalent amount of memory. ### Server Memory -For example, if your code loads a Machine Learning model with **1 GB in size**, when you run one process with your API, it will consume at least 1 GB or RAM. And if you start **4 processes** (4 workers), each will consume 1 GB of RAM. So, in total your API will consume **4 GB of RAM**. +For example, if your code loads a Machine Learning model with **1 GB in size**, when you run one process with your API, it will consume at least 1 GB of RAM. And if you start **4 processes** (4 workers), each will consume 1 GB of RAM. So in total, your API will consume **4 GB of RAM**. And if your remote server or virtual machine only has 3 GB of RAM, trying to load more than 4 GB of RAM will cause problems. 🚨 @@ -253,12 +253,12 @@ But in most cases, you will want to perform these steps only **once**. So, you will want to have a **single process** to perform those **previous steps**, before starting the application. -And you will have to make sure that it's a single process running those previous steps *even* if afterwards you start **multiple processes** (multiple workers) for the application itself. If those steps were run by **multiple processes**, they would **duplicate** the work by running it on **parallel**, and if the steps were something delicate like a database migration, they could cause conflicts with each other. +And you will have to make sure that it's a single process running those previous steps *even* if afterwards, you start **multiple processes** (multiple workers) for the application itself. If those steps were run by **multiple processes**, they would **duplicate** the work by running it on **parallel**, and if the steps were something delicate like a database migration, they could cause conflicts with each other. -Of course, there are some cases where there's no problem in running the previous steps multiple times, in that case it's a lot easier to handle. +Of course, there are some cases where there's no problem in running the previous steps multiple times, in that case, it's a lot easier to handle. !!! tip - Also have in mind that depending on your setup, in some cases you **might not even need any previous steps** before starting your application. + Also, have in mind that depending on your setup, in some cases you **might not even need any previous steps** before starting your application. In that case, you wouldn't have to worry about any of this. 🤷 @@ -279,7 +279,7 @@ Here are some possible ideas: Your server(s) is (are) a **resource**, you can consume or **utilize**, with your programs, the computation time on the CPUs, and the RAM memory available. -How much resources do you want to be consuming/utilizing? It might be easy to think "not much", but in reality, you will probably want to consume **as much as possible without crashing**. +How much of the system resources do you want to be consuming/utilizing? It might be easy to think "not much", but in reality, you will probably want to consume **as much as possible without crashing**. If you are paying for 3 servers but you are using only a little bit of their RAM and CPU, you are probably **wasting money** 💸, and probably **wasting server electric power** 🌎, etc. @@ -291,9 +291,9 @@ In this case, it would be better to get **one extra server** and run some proces There's also the chance that for some reason you have a **spike** of usage of your API. Maybe it went viral, or maybe some other services or bots start using it. And you might want to have extra resources to be safe in those cases. -You could put an **arbitrary number** to target, for example something **between 50% to 90%** of resource utilization. The point is that those are probably the main things you will want to measure and use to tweak your deployments. +You could put an **arbitrary number** to target, for example, something **between 50% to 90%** of resource utilization. The point is that those are probably the main things you will want to measure and use to tweak your deployments. -You can use simple tools like `htop` to see the CPU and RAM used in your server, or the amount used by each process. Or you can use more complex monitoring tools, maybe distributed across servers, etc. +You can use simple tools like `htop` to see the CPU and RAM used in your server or the amount used by each process. Or you can use more complex monitoring tools, which may be distributed across servers, etc. ## Recap @@ -308,4 +308,4 @@ You have been reading here some of the main concepts that you would probably nee Understanding these ideas and how to apply them should give you the intuition necessary to take any decisions when configuring and tweaking your deployments. 🤓 -In the next sections I'll give you more concrete examples of possible strategies you can follow. 🚀 +In the next sections, I'll give you more concrete examples of possible strategies you can follow. 🚀 diff --git a/docs/en/docs/deployment/deta.md b/docs/en/docs/deployment/deta.md index b0d1cb928a4cc..c0dc3336a97e3 100644 --- a/docs/en/docs/deployment/deta.md +++ b/docs/en/docs/deployment/deta.md @@ -9,7 +9,7 @@ It will take you about **10 minutes**. ## A basic **FastAPI** app -* Create a directory for your app, for example `./fastapideta/` and enter in it. +* Create a directory for your app, for example, `./fastapideta/` and enter into it. ### FastAPI code @@ -213,7 +213,7 @@ Now you can share that URL with anyone and they will be able to access your API. Congrats! You deployed your FastAPI app to Deta! 🎉 🍰 -Also notice that Deta correctly handles HTTPS for you, so you don't have to take care of that and can be sure that your clients will have a secure encrypted connection. ✅ 🔒 +Also, notice that Deta correctly handles HTTPS for you, so you don't have to take care of that and can be sure that your clients will have a secure encrypted connection. ✅ 🔒 ## Check the Visor @@ -235,7 +235,7 @@ You can also edit them and re-play them. ## Learn more -At some point you will probably want to store some data for your app in a way that persists through time. For that you can use Deta Base, it also has a generous **free tier**. +At some point, you will probably want to store some data for your app in a way that persists through time. For that you can use Deta Base, it also has a generous **free tier**. You can also read more in the Deta Docs. @@ -253,6 +253,6 @@ Coming back to the concepts we discussed in [Deployments Concepts](./concepts.md !!! note Deta is designed to make it easy (and free) to deploy simple applications quickly. - It can simplify a lot several use cases, but at the same time it doesn't support others, like using external databases (apart from Deta's own NoSQL database system), custom virtual machines, etc. + It can simplify several use cases, but at the same time, it doesn't support others, like using external databases (apart from Deta's own NoSQL database system), custom virtual machines, etc. You can read more details in the Deta docs to see if it's the right choice for you. diff --git a/docs/en/docs/deployment/docker.md b/docs/en/docs/deployment/docker.md index e25401f20eba2..3f86efcced275 100644 --- a/docs/en/docs/deployment/docker.md +++ b/docs/en/docs/deployment/docker.md @@ -1,6 +1,6 @@ # FastAPI in Containers - Docker -When deploying FastAPI applications a common approach is to build a **Linux container image**. It's normally done using **Docker**. And then you can deploy that container image in one of different possible ways. +When deploying FastAPI applications a common approach is to build a **Linux container image**. It's normally done using **Docker**. You can then deploy that container image in one of a few possible ways. Using Linux containers has several advantages including **security**, **replicability**, **simplicity**, and others. @@ -68,13 +68,13 @@ And there are many other images for different things like databases, for example * MongoDB * Redis, etc. -By using a pre-made container image it's very easy to **combine** and use different tools. For example, to try out a new database. In most cases you can use the **official images**, and just configure them with environment variables. +By using a pre-made container image it's very easy to **combine** and use different tools. For example, to try out a new database. In most cases, you can use the **official images**, and just configure them with environment variables. That way, in many cases you can learn about containers and Docker and re-use that knowledge with many different tools and components. So, you would run **multiple containers** with different things, like a database, a Python application, a web server with a React frontend application, and connect them together via their internal network. -All the container management systems (like Docker or Kubernetes) have these networking features integrated in them. +All the container management systems (like Docker or Kubernetes) have these networking features integrated into them. ## Containers and Processes @@ -84,7 +84,7 @@ When a **container** is started, it will run that command/program (although you A container is running as long as the **main process** (command or program) is running. -A container normally has a **single process**, but it's also possible to start subprocesses from the main process, and that way have **multiple processes** in the same container. +A container normally has a **single process**, but it's also possible to start subprocesses from the main process, and that way you will have **multiple processes** in the same container. But it's not possible to have a running container without **at least one running process**. If the main process stops, the container stops. @@ -137,7 +137,7 @@ Successfully installed fastapi pydantic uvicorn ### Create the **FastAPI** Code -* Create an `app` directory and enter in it. +* Create an `app` directory and enter it. * Create an empty file `__init__.py`. * Create a `main.py` file with: @@ -216,7 +216,7 @@ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] 6. Set the **command** to run the `uvicorn` server. - `CMD` takes a list of strings, each of this strings is what you would type in the command line separated by spaces. + `CMD` takes a list of strings, each of these strings is what you would type in the command line separated by spaces. This command will be run from the **current working directory**, the same `/code` directory you set above with `WORKDIR /code`. @@ -338,7 +338,7 @@ You will see the alternative automatic documentation (provided by cluster of machines with **Kubernetes**, Docker Swarm Mode, Nomad, or other similar complex system to manage distributed containers on multiple machines, then you will probably want to **handle replication** at the **cluster level** instead of using a **process manager** (like Gunicorn with workers) in each container. +If you have a cluster of machines with **Kubernetes**, Docker Swarm Mode, Nomad, or another similar complex system to manage distributed containers on multiple machines, then you will probably want to **handle replication** at the **cluster level** instead of using a **process manager** (like Gunicorn with workers) in each container. One of those distributed container management systems like Kubernetes normally has some integrated way of handling **replication of containers** while still supporting **load balancing** for the incoming requests. All at the **cluster level**. @@ -487,7 +487,7 @@ The main point is, **none** of these are **rules written in stone** that you hav ## Memory -If you run **a single process per container** you will have a more or less well defined, stable, and limited amount of memory consumed by each of of those containers (more than one if they are replicated). +If you run **a single process per container** you will have a more or less well-defined, stable, and limited amount of memory consumed by each of those containers (more than one if they are replicated). And then you can set those same memory limits and requirements in your configurations for your container management system (for example in **Kubernetes**). That way it will be able to **replicate the containers** in the **available machines** taking into account the amount of memory needed by them, and the amount available in the machines in the cluster. diff --git a/docs/en/docs/deployment/https.md b/docs/en/docs/deployment/https.md index 1a3b1a0aade6c..790976a718f78 100644 --- a/docs/en/docs/deployment/https.md +++ b/docs/en/docs/deployment/https.md @@ -187,4 +187,4 @@ Having **HTTPS** is very important, and quite **critical** in most cases. Most o But once you know the basic information of **HTTPS for developers** you can easily combine and configure different tools to help you manage everything in a simple way. -In some of the next chapters I'll show you several concrete examples of how to set up **HTTPS** for **FastAPI** applications. 🔒 +In some of the next chapters, I'll show you several concrete examples of how to set up **HTTPS** for **FastAPI** applications. 🔒 diff --git a/docs/en/docs/deployment/index.md b/docs/en/docs/deployment/index.md index d1941ad93b04a..f0fd001cd511a 100644 --- a/docs/en/docs/deployment/index.md +++ b/docs/en/docs/deployment/index.md @@ -8,7 +8,7 @@ To **deploy** an application means to perform the necessary steps to make it **a For a **web API**, it normally involves putting it in a **remote machine**, with a **server program** that provides good performance, stability, etc, so that your **users** can **access** the application efficiently and without interruptions or problems. -This is in contrast to the the **development** stages, where you are constantly changing the code, breaking it and fixing it, stopping and restarting the development server, etc. +This is in contrast to the **development** stages, where you are constantly changing the code, breaking it and fixing it, stopping and restarting the development server, etc. ## Deployment Strategies diff --git a/docs/en/docs/deployment/server-workers.md b/docs/en/docs/deployment/server-workers.md index 84a2b0f33f7a2..4ccd9d9f69a8b 100644 --- a/docs/en/docs/deployment/server-workers.md +++ b/docs/en/docs/deployment/server-workers.md @@ -20,7 +20,7 @@ Here I'll show you how to use