diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 6a512a019..c9723b25b 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -29,7 +29,7 @@ jobs:
id: cache
with:
path: ${{ env.pythonLocation }}
- key: ${{ runner.os }}-python-${{ env.pythonLocation }}-pydantic-v2-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-test-v04
+ key: ${{ runner.os }}-python-${{ env.pythonLocation }}-pydantic-v2-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-test-v05
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-tests.txt
@@ -62,7 +62,7 @@ jobs:
id: cache
with:
path: ${{ env.pythonLocation }}
- key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ matrix.pydantic-version }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-test-v04
+ key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ matrix.pydantic-version }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-test-v05
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-tests.txt
diff --git a/.gitignore b/.gitignore
index d380d16b7..9be494cec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,6 @@ archive.zip
*~
.*.sw?
.cache
+
+# macOS
+.DS_Store
diff --git a/README.md b/README.md
index 50f80ded6..266213426 100644
--- a/README.md
+++ b/README.md
@@ -49,6 +49,7 @@ The key features are:
+
@@ -56,6 +57,7 @@ The key features are:
+
diff --git a/docs/em/docs/advanced/extending-openapi.md b/docs/em/docs/advanced/extending-openapi.md
deleted file mode 100644
index 496a8d9de..000000000
--- a/docs/em/docs/advanced/extending-openapi.md
+++ /dev/null
@@ -1,314 +0,0 @@
-# โ ๐
-
-!!! warning
- ๐ ๐ ๐ง โ. ๐ ๐ฒ ๐ช ๐ถ โซ๏ธ.
-
- ๐ฅ ๐ ๐ ๐ฐ - ๐ฉโ๐ป ๐ฆฎ, ๐ ๐ช ๐ฒ ๐ถ ๐ ๐.
-
- ๐ฅ ๐ โช ๐ญ ๐ ๐ ๐ช ๐ ๐ ๐ ๐, ๐ฃ ๐.
-
-๐ค ๐ผ ๐โ ๐ ๐ช ๐ช ๐ ๐ ๐ ๐.
-
-๐ ๐ ๐ ๐ ๐ โ.
-
-## ๐ ๐ ๏ธ
-
-๐ (๐ข) ๐ ๏ธ, โฉ.
-
-`FastAPI` ๐ธ (๐) โ๏ธ `.openapi()` ๐ฉโ๐ฌ ๐ ๐ ๐จ ๐ ๐.
-
-๐ ๐ธ ๐ ๐, *โก ๐ ๏ธ* `/openapi.json` (โ๏ธ โซ๏ธโ ๐ โ ๐ `openapi_url`) ยฎ.
-
-โซ๏ธ ๐จ ๐ป ๐จ โฎ๏ธ ๐ ๐ธ `.openapi()` ๐ฉโ๐ฌ.
-
-๐ข, โซ๏ธโ ๐ฉโ๐ฌ `.openapi()` ๐จ โ
๐ `.openapi_schema` ๐ ๐ฅ โซ๏ธ โ๏ธ ๐ & ๐จ ๐ซ.
-
-๐ฅ โซ๏ธ ๐ซ, โซ๏ธ ๐ ๐ซ โ๏ธ ๐ ๐ข `fastapi.openapi.utils.get_openapi`.
-
-& ๐ ๐ข `get_openapi()` ๐จ ๐ข:
-
-* `title`: ๐ ๐, ๐ฆ ๐ฉบ.
-* `version`: โฌ ๐ ๐ ๏ธ, โ
`2.5.0`.
-* `openapi_version`: โฌ ๐ ๐ง โ๏ธ. ๐ข, โช: `3.0.2`.
-* `description`: ๐ ๐ ๐ ๏ธ.
-* `routes`: ๐ ๐ฃ, ๐ซ ๐ ยฎ *โก ๐ ๏ธ*. ๐ซ โ โช๏ธโก๏ธ `app.routes`.
-
-## ๐ ๐ข
-
-โ๏ธ โน ๐, ๐ ๐ช โ๏ธ ๐ ๐ ๐ข ๐ ๐ ๐ & ๐ ๐ ๐ ๐ ๐ ๐ช.
-
-๐ผ, โก๏ธ ๐ฎ ๐ ๐ โ ๐ ๐ ๐ฑ.
-
-### ๐ **FastAPI**
-
-๐ฅ, โ ๐ ๐ **FastAPI** ๐ธ ๐:
-
-```Python hl_lines="1 4 7-9"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### ๐ ๐ ๐
-
-โคด๏ธ, โ๏ธ ๐ ๐ ๐ข ๐ ๐ ๐, ๐ `custom_openapi()` ๐ข:
-
-```Python hl_lines="2 15-20"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### ๐ ๐ ๐
-
-๐ ๐ ๐ช ๐ฎ ๐ โ, โ ๐ `x-logo` `info` "๐" ๐ ๐:
-
-```Python hl_lines="21-23"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### ๐พ ๐ ๐
-
-๐ ๐ช โ๏ธ ๐ `.openapi_schema` "๐พ", ๐ช ๐ ๐ ๐.
-
-๐ ๐, ๐ ๐ธ ๐ ๐ซ โ๏ธ ๐ ๐ ๐ ๐ฐ ๐ฉโ๐ป ๐ ๐ ๐ ๏ธ ๐ฉบ.
-
-โซ๏ธ ๐ ๐ ๐ด ๐, & โคด๏ธ ๐ ๐พ ๐ ๐ โ๏ธ โญ ๐จ.
-
-```Python hl_lines="13-14 24-25"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### ๐ ๐ฉโ๐ฌ
-
-๐ ๐ ๐ช โ `.openapi()` ๐ฉโ๐ฌ โฎ๏ธ ๐ ๐ ๐ข.
-
-```Python hl_lines="28"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### โ
โซ๏ธ
-
-๐ ๐ ๐ถ http://127.0.0.1:8000/redoc ๐ ๐ ๐ ๐ ๐ โ๏ธ ๐ ๐ ๐ฑ (๐ ๐ผ, **FastAPI**'โ ๐ฑ):
-
-
-
-## ๐ค-๐ธ ๐ธ & ๐ ๐ฉบ
-
-๐ ๏ธ ๐ฉบ โ๏ธ **๐ฆ ๐** & **๐**, & ๐ ๐ ๐ช ๐ธ & ๐ ๐.
-
-๐ข, ๐ ๐ ๐ฆ โช๏ธโก๏ธ ๐ฒ.
-
-โ๏ธ โซ๏ธ ๐ช ๐ โซ๏ธ, ๐ ๐ช โ ๐ฏ ๐ฒ, โ๏ธ ๐ฆ ๐ ๐.
-
-๐ โ , ๐ผ, ๐ฅ ๐ ๐ช ๐ ๐ฑ ๐ง ๐ท โช ๐ฑ, ๐ต ๐ ๐ธ ๐, โ๏ธ ๐ง๐ฟ ๐ธ.
-
-๐ฅ ๐ ๐ ๐ โ ๐ฆ ๐ ๐ ๐, ๐ FastAPI ๐ฑ, & ๐ ๐ฉบ โ๏ธ ๐ซ.
-
-### ๐ ๐ ๐
-
-โก๏ธ ๐ฌ ๐ ๐ ๐ ๐ ๐ ๐ ๐:
-
-```
-.
-โโโ app
-โ โโโ __init__.py
-โ โโโ main.py
-```
-
-๐ โ ๐ ๐ช ๐ ๐ป ๐.
-
-๐ ๐ ๐ ๐ ๐ช ๐ ๐ ๐:
-
-```
-.
-โโโ app
-โย ย โโโ __init__.py
-โย ย โโโ main.py
-โโโ static/
-```
-
-### โฌ ๐
-
-โฌ ๐ป ๐ ๐ช ๐ฉบ & ๐ฎ ๐ซ ๐ ๐ `static/` ๐.
-
-๐ ๐ช ๐ฒ โถ๏ธ๏ธ-๐ ๐ ๐ & ๐ ๐ ๐ `Save link as...`.
-
-**๐ฆ ๐** โ๏ธ ๐:
-
-* `swagger-ui-bundle.js`
-* `swagger-ui.css`
-
-& **๐** โ๏ธ ๐:
-
-* `redoc.standalone.js`
-
-โฎ๏ธ ๐, ๐ ๐ ๐ ๐ช ๐ ๐:
-
-```
-.
-โโโ app
-โย ย โโโ __init__.py
-โย ย โโโ main.py
-โโโ static
- โโโ redoc.standalone.js
- โโโ swagger-ui-bundle.js
- โโโ swagger-ui.css
-```
-
-### ๐ฆ ๐ป ๐
-
-* ๐ `StaticFiles`.
-* "๐ป" `StaticFiles()` ๐ ๐ฏ โก.
-
-```Python hl_lines="7 11"
-{!../../../docs_src/extending_openapi/tutorial002.py!}
-```
-
-### ๐ฏ ๐ป ๐
-
-โถ๏ธ ๐ ๐ธ & ๐ถ http://127.0.0.1:8000/static/redoc.standalone.js.
-
-๐ ๐ ๐ ๐ถ ๐ ๐ธ ๐ **๐**.
-
-โซ๏ธ ๐ช โถ๏ธ โฎ๏ธ ๐ณ ๐:
-
-```JavaScript
-/*!
- * ReDoc - OpenAPI/Swagger-generated API Reference Documentation
- * -------------------------------------------------------------
- * Version: "2.0.0-rc.18"
- * Repo: https://github.com/Redocly/redoc
- */
-!function(e,t){"object"==typeof exports&&"object"==typeof m
-
-...
-```
-
-๐ โ ๐ ๐ ๐โโ ๐ช ๐ฆ ๐ป ๐ โช๏ธโก๏ธ ๐ ๐ฑ, & ๐ ๐ ๐ฅ ๐ป ๐ ๐ฉบ โ ๐ฅ.
-
-๐ ๐ฅ ๐ช ๐ ๐ฑ โ๏ธ ๐ ๐ป ๐ ๐ฉบ.
-
-### โ ๐ง ๐ฉบ
-
-๐ฅ ๐ โ ๐ง ๐ฉบ, ๐ โ๏ธ ๐ฒ ๐ข.
-
-โ ๐ซ, โ ๐ซ ๐ `None` ๐โ ๐ ๐ `FastAPI` ๐ฑ:
-
-```Python hl_lines="9"
-{!../../../docs_src/extending_openapi/tutorial002.py!}
-```
-
-### ๐ ๐ ๐ฉบ
-
-๐ ๐ ๐ช โ *โก ๐ ๏ธ* ๐ ๐ฉบ.
-
-๐ ๐ช ๐ค-โ๏ธ FastAPI ๐ ๐ข โ ๐ธ ๐ ๐ฉบ, & ๐ถโโ๏ธ ๐ซ ๐ช โ:
-
-* `openapi_url`: ๐ ๐โ ๐ธ ๐ ๐ฉบ ๐ช ๐ค ๐ ๐ ๐ ๐ ๏ธ. ๐ ๐ช โ๏ธ ๐ฅ ๐ข `app.openapi_url`.
-* `title`: ๐ ๐ ๐ ๏ธ.
-* `oauth2_redirect_url`: ๐ ๐ช โ๏ธ `app.swagger_ui_oauth2_redirect_url` ๐ฅ โ๏ธ ๐ข.
-* `swagger_js_url`: ๐ ๐โ ๐ธ ๐ ๐ฆ ๐ ๐ฉบ ๐ช ๐ค **๐ธ** ๐. ๐ 1๏ธโฃ ๐ ๐ ๐ ๐ฑ ๐ ๐ฆ.
-* `swagger_css_url`: ๐ ๐โ ๐ธ ๐ ๐ฆ ๐ ๐ฉบ ๐ช ๐ค **๐** ๐. ๐ 1๏ธโฃ ๐ ๐ ๐ ๐ฑ ๐ ๐ฆ.
-
-& โก ๐...
-
-```Python hl_lines="2-6 14-22 25-27 30-36"
-{!../../../docs_src/extending_openapi/tutorial002.py!}
-```
-
-!!! tip
- *โก ๐ ๏ธ* `swagger_ui_redirect` ๐ฉโ๐ ๐โ ๐ โ๏ธ Oauth2๏ธโฃ.
-
- ๐ฅ ๐ ๐ ๏ธ ๐ ๐ ๏ธ โฎ๏ธ Oauth2๏ธโฃ ๐โ๐ฆบ, ๐ ๐ ๐ช ๐ & ๐ ๐ ๐ ๏ธ ๐ฉบ โฎ๏ธ ๐ ๐. & ๐ โฎ๏ธ โซ๏ธ โ๏ธ ๐ฐ Oauth2๏ธโฃ ๐ค.
-
- ๐ฆ ๐ ๐ ๐ต โซ๏ธ โ
๐ ๐, โ๏ธ โซ๏ธ ๐ช ๐ "โ" ๐ฉโ๐.
-
-### โ *โก ๐ ๏ธ* ๐ฏ โซ๏ธ
-
-๐, ๐ช ๐ฏ ๐ ๐ ๐ท, โ *โก ๐ ๏ธ*:
-
-```Python hl_lines="39-41"
-{!../../../docs_src/extending_openapi/tutorial002.py!}
-```
-
-### ๐ฏ โซ๏ธ
-
-๐, ๐ ๐ ๐ช ๐ ๐ ๐ป, ๐ถ ๐ ๐ฉบ http://127.0.0.1:8000/docs, & ๐ ๐.
-
-& ๐ต ๐ธ, ๐ ๐ ๐ช ๐ ๐ฉบ ๐ ๐ ๏ธ & ๐ โฎ๏ธ โซ๏ธ.
-
-## ๐ ๏ธ ๐ฆ ๐
-
-๐ ๐ช ๐ โ ๐ฆ ๐ ๐ข.
-
-๐ ๐ซ, ๐ถโโ๏ธ `swagger_ui_parameters` โ ๐โ ๐ `FastAPI()` ๐ฑ ๐ โ๏ธ `get_swagger_ui_html()` ๐ข.
-
-`swagger_ui_parameters` ๐จ ๐ โฎ๏ธ ๐ณ ๐ถโโ๏ธ ๐ฆ ๐ ๐.
-
-FastAPI ๐ ๐ณ **๐ป** โ ๐ซ ๐ โฎ๏ธ ๐ธ, ๐ โซ๏ธโ ๐ฆ ๐ ๐ช.
-
-### โ โ ๐ฆ
-
-๐ผ, ๐ ๐ช โ โ ๐ฆ ๐ฆ ๐.
-
-๐ต ๐ โ, โ ๐ฆ ๐ ๏ธ ๐ข:
-
-
-
-โ๏ธ ๐ ๐ช โ โซ๏ธ โ `syntaxHighlight` `False`:
-
-```Python hl_lines="3"
-{!../../../docs_src/extending_openapi/tutorial003.py!}
-```
-
-...& โคด๏ธ ๐ฆ ๐ ๐ ๐ซ ๐ฆ โ ๐ฆ ๐ซ๐:
-
-
-
-### ๐ ๐ข
-
-๐ ๐ ๐ ๐ช โ โ ๐ฆ ๐ข โฎ๏ธ ๐ `"syntaxHighlight.theme"` (๐ ๐ โซ๏ธ โ๏ธ โฃ ๐):
-
-```Python hl_lines="3"
-{!../../../docs_src/extending_openapi/tutorial004.py!}
-```
-
-๐ ๐ณ ๐ ๐ โ ๐ฆ ๐จ ๐ข:
-
-
-
-### ๐ ๐ข ๐ฆ ๐ ๐ข
-
-FastAPI ๐ ๐ข ๐ณ ๐ข โ ๐
โ๏ธ ๐ผ.
-
-โซ๏ธ ๐ ๐ซ ๐ข ๐ณ:
-
-```Python
-{!../../../fastapi/openapi/docs.py[ln:7-13]!}
-```
-
-๐ ๐ช ๐ ๐ ๐ซ โ ๐ ๐ฒ โ `swagger_ui_parameters`.
-
-๐ผ, โ `deepLinking` ๐ ๐ช ๐ถโโ๏ธ ๐ โ `swagger_ui_parameters`:
-
-```Python hl_lines="3"
-{!../../../docs_src/extending_openapi/tutorial005.py!}
-```
-
-### ๐ ๐ฆ ๐ ๐ข
-
-๐ ๐ ๐ ๐ช ๐ณ ๐ ๐ช โ๏ธ, โ ๐ ๐ฉบ ๐ฆ ๐ ๐ข.
-
-### ๐ธ-๐ด โ
-
-๐ฆ ๐ โ ๐ ๐ณ **๐ธ-๐ด** ๐ (๐ผ, ๐ธ ๐ข).
-
-FastAPI ๐ ๐ซ ๐ธ-๐ด `presets` โ:
-
-```JavaScript
-presets: [
- SwaggerUIBundle.presets.apis,
- SwaggerUIBundle.SwaggerUIStandalonePreset
-]
-```
-
-๐ซ **๐ธ** ๐, ๐ซ ๐ป, ๐ ๐ช ๐ซ ๐ถโโ๏ธ ๐ซ โช๏ธโก๏ธ ๐ ๐ ๐.
-
-๐ฅ ๐ ๐ช โ๏ธ ๐ธ-๐ด ๐ณ ๐ ๐, ๐ ๐ช โ๏ธ 1๏ธโฃ ๐ฉโ๐ฌ ๐. ๐ ๐ ๐ฆ ๐ *โก ๐ ๏ธ* & โ โ ๐ ๐ธ ๐ ๐ช.
diff --git a/docs/em/docs/deployment/deta.md b/docs/em/docs/deployment/deta.md
deleted file mode 100644
index 89b6c4bdb..000000000
--- a/docs/em/docs/deployment/deta.md
+++ /dev/null
@@ -1,258 +0,0 @@
-# ๐ ๏ธ FastAPI ๐ ๐ช
-
-๐ ๐ ๐ ๐ ๐ก โ ๐ช ๐ ๏ธ **FastAPI** ๐ธ ๐ ๐ช โ๏ธ ๐ ๐. ๐ถ
-
-โซ๏ธ ๐ โ ๐ ๐ **1๏ธโฃ0๏ธโฃ โฒ**.
-
-!!! info
- ๐ช **FastAPI** ๐ฐ. ๐ถ
-
-## ๐ฐ **FastAPI** ๐ฑ
-
-* โ ๐ ๐ ๐ฑ, ๐ผ, `./fastapideta/` & โ ๐ โซ๏ธ.
-
-### FastAPI ๐
-
-* โ `main.py` ๐ โฎ๏ธ:
-
-```Python
-from fastapi import FastAPI
-
-app = FastAPI()
-
-
-@app.get("/")
-def read_root():
- return {"Hello": "World"}
-
-
-@app.get("/items/{item_id}")
-def read_item(item_id: int):
- return {"item_id": item_id}
-```
-
-### ๐
-
-๐, ๐ ๐ โ ๐ `requirements.txt` โฎ๏ธ:
-
-```text
-fastapi
-```
-
-!!! tip
- ๐ ๐ซ ๐ช โ Uvicorn ๐ ๏ธ ๐ ๐ช, ๐ ๐ ๐ ๐ฒ ๐ โ โซ๏ธ ๐ ๐ฏ ๐ ๐ฑ.
-
-### ๐ ๐
-
-๐ ๐ ๐ โ๏ธ 1๏ธโฃ ๐ `./fastapideta/` โฎ๏ธ 2๏ธโฃ ๐:
-
-```
-.
-โโโ main.py
-โโโ requirements.txt
-```
-
-## โ ๐ ๐ช ๐ง
-
-๐ โ ๐ ๐ง ๐ ๐ช, ๐ ๐ช ๐ง & ๐.
-
-๐ ๐ซ ๐ช ๐ณ.
-
-## โ โณ
-
-๐ ๐ โ๏ธ ๐ ๐ง, โ ๐ช โณ:
-
-=== "๐พ, ๐ธ๐ป"
-
-
-
- ```console
- $ curl -fsSL https://get.deta.dev/cli.sh | sh
- ```
-
-
-
-=== "๐ช ๐"
-
-
-
- ```console
- $ iwr https://get.deta.dev/cli.ps1 -useb | iex
- ```
-
-
-
-โฎ๏ธ โ โซ๏ธ, ๐ ๐ ๐ถ ๐ โ โณ ๐.
-
-๐ ๐ถ, โ ๐ โซ๏ธ โ โ โฎ๏ธ:
-
-
-
-```console
-$ deta --help
-
-Deta command line interface for managing deta micros.
-Complete documentation available at https://docs.deta.sh
-
-Usage:
- deta [flags]
- deta [command]
-
-Available Commands:
- auth Change auth settings for a deta micro
-
-...
-```
-
-
-
-!!! tip
- ๐ฅ ๐ โ๏ธ โ โ โณ, โ
๐ ๐ช ๐ฉบ.
-
-## ๐ณ โฎ๏ธ โณ
-
-๐ ๐ณ ๐ช โช๏ธโก๏ธ โณ โฎ๏ธ:
-
-
-
-```console
-$ deta login
-
-Please, log in from the web page. Waiting..
-Logged in successfully.
-```
-
-
-
-๐ ๐ ๐ ๐ธ ๐ฅ & ๐ ๐.
-
-## ๐ ๏ธ โฎ๏ธ ๐ช
-
-โญ, ๐ ๏ธ ๐ ๐ธ โฎ๏ธ ๐ช โณ:
-
-
-
-```console
-$ deta new
-
-Successfully created a new micro
-
-// Notice the "endpoint" ๐
-
-{
- "name": "fastapideta",
- "runtime": "python3.7",
- "endpoint": "https://qltnci.deta.dev",
- "visor": "enabled",
- "http_auth": "enabled"
-}
-
-Adding dependencies...
-
-
----> 100%
-
-
-Successfully installed fastapi-0.61.1 pydantic-1.7.2 starlette-0.13.6
-```
-
-
-
-๐ ๐ ๐ ๐ป ๐ง ๐:
-
-```JSON hl_lines="4"
-{
- "name": "fastapideta",
- "runtime": "python3.7",
- "endpoint": "https://qltnci.deta.dev",
- "visor": "enabled",
- "http_auth": "enabled"
-}
-```
-
-!!! tip
- ๐ ๐ ๏ธ ๐ โ๏ธ ๐ `"endpoint"` ๐.
-
-## โ
โซ๏ธ
-
-๐ ๐ ๐ ๐ฅ ๐ `endpoint` ๐. ๐ผ ๐ โซ๏ธ `https://qltnci.deta.dev`, โ๏ธ ๐ ๐ ๐.
-
-๐ ๐ ๐ ๐ป ๐จ โช๏ธโก๏ธ ๐ FastAPI ๐ฑ:
-
-```JSON
-{
- "Hello": "World"
-}
-```
-
-& ๐ ๐ถ `/docs` ๐ ๐ ๏ธ, ๐ผ ๐ โซ๏ธ ๐ `https://qltnci.deta.dev/docs`.
-
-โซ๏ธ ๐ ๐ฆ ๐ ๐ฉบ ๐:
-
-
-
-## ๐ ๏ธ ๐ข ๐
-
-๐ข, ๐ช ๐ ๐ต ๐ค โ๏ธ ๐ช ๐ ๐ง.
-
-โ๏ธ ๐ ๐ ๐, ๐ ๐ช โ โซ๏ธ ๐ข โฎ๏ธ:
-
-
-
-```console
-$ deta auth disable
-
-Successfully disabled http auth
-```
-
-
-
-๐ ๐ ๐ช ๐ฐ ๐ ๐ โฎ๏ธ ๐ & ๐ซ ๐ ๐ช ๐ ๐ ๐ ๏ธ. ๐ถ
-
-## ๐บ๐ธ๐
-
-ใ โ ๐ ๐ ๏ธ ๐ FastAPI ๐ฑ ๐ช โ ๐ถ ๐ถ
-
-, ๐ ๐ ๐ช โ ๐ต ๐บ๐ธ๐ ๐, ๐ ๐ซ โ๏ธ โ ๐
๐ & ๐ช ๐ญ ๐ ๐ ๐ฉโ๐ป ๐ โ๏ธ ๐ ๐ ๐. ๐ถ ๐ถ
-
-## โ
๐ถ
-
-โช๏ธโก๏ธ ๐ ๐ฉบ ๐ (๐ซ ๐ ๐ ๐ `https://qltnci.deta.dev/docs`) ๐จ ๐จ ๐ *โก ๐ ๏ธ* `/items/{item_id}`.
-
-๐ผ โฎ๏ธ ๐ `5`.
-
-๐ ๐ถ https://web.deta.sh.
-
-๐ ๐ ๐ ๐ค ๐ โ๏ธ ๐ค "โพ" โฎ๏ธ ๐ ๐ ๐ฑ.
-
-๐ ๐ ๐ ๐ โฎ๏ธ "โน", & ๐ "๐ถ", ๐ถ ๐ "๐ถ".
-
-๐ค ๐ ๐ช โ โฎ๏ธ ๐จ ๐จ ๐ ๐ฑ.
-
-๐ ๐ช โ ๐ซ & ๐ค-๐คพ ๐ซ.
-
-
-
-## ๐ก ๐
-
-โ, ๐ ๐ ๐ฒ ๐ ๐ช ๐ฝ ๐ ๐ฑ ๐ ๐ ๐ฃ ๐ ๐ฐ. ๐ ๐ ๐ช โ๏ธ ๐ช ๐งข, โซ๏ธ โ๏ธ ๐ **๐ ๐**.
-
-๐ ๐ช โ ๐
๐ช ๐ฉบ.
-
-## ๐ ๏ธ ๐ง
-
-๐ ๐ ๐ง ๐ฅ ๐ฌ [๐ ๏ธ ๐ง](./concepts.md){.internal-link target=_blank}, ๐ฅ โ ๐ ๐ซ ๐ ๐ต โฎ๏ธ ๐ช:
-
-* **๐บ๐ธ๐**: ๐ต ๐ช, ๐ซ ๐ ๐ค ๐ ๐ & ๐ต ๐บ๐ธ๐ ๐.
-* **๐โโ ๐ ๐ด**: ๐ต ๐ช, ๐ ๐ซ ๐โ๐ฆบ.
-* **โ**: ๐ต ๐ช, ๐ ๐ซ ๐โ๐ฆบ.
-* **๐งฌ**: ๐ต ๐ช, ๐ ๐ซ ๐โ๐ฆบ.
-* **๐พ**: ๐ ๐ ๐ช, ๐ ๐ช ๐ง ๐ซ ๐ โซ๏ธ.
-* **โฎ๏ธ ๐ โญ โถ๏ธ**: ๐ซ ๐ ๐โ๐ฆบ, ๐ ๐ช โ โซ๏ธ ๐ท โฎ๏ธ ๐ซ ๐พ โ๏ธ โ๏ธ ๐ โ.
-
-!!! note
- ๐ช ๐ง โ โซ๏ธ โฉ (& ๐) ๐ ๏ธ ๐
๐ธ ๐.
-
- โซ๏ธ ๐ช ๐ ๐ โ๏ธ ๐ผ, โ๏ธ ๐ ๐ฐ, โซ๏ธ ๐ซ ๐โ๐ฆบ ๐, ๐ โ๏ธ ๐ข ๐ฝ (โ๏ธ โช๏ธโก๏ธ ๐ช ๐ โ ๐ฝ โ๏ธ), ๐ ๐น ๐ฐ, โ๏ธ.
-
- ๐ ๐ช โ ๐
โน ๐ช ๐ฉบ ๐ ๐ฅ โซ๏ธ โถ๏ธ๏ธ โ ๐.
diff --git a/docs/em/docs/advanced/conditional-openapi.md b/docs/em/docs/how-to/conditional-openapi.md
similarity index 100%
rename from docs/em/docs/advanced/conditional-openapi.md
rename to docs/em/docs/how-to/conditional-openapi.md
diff --git a/docs/em/docs/advanced/custom-request-and-route.md b/docs/em/docs/how-to/custom-request-and-route.md
similarity index 100%
rename from docs/em/docs/advanced/custom-request-and-route.md
rename to docs/em/docs/how-to/custom-request-and-route.md
diff --git a/docs/em/docs/how-to/extending-openapi.md b/docs/em/docs/how-to/extending-openapi.md
new file mode 100644
index 000000000..6b3bc0075
--- /dev/null
+++ b/docs/em/docs/how-to/extending-openapi.md
@@ -0,0 +1,90 @@
+# โ ๐
+
+!!! warning
+ ๐ ๐ ๐ง โ. ๐ ๐ฒ ๐ช ๐ถ โซ๏ธ.
+
+ ๐ฅ ๐ ๐ ๐ฐ - ๐ฉโ๐ป ๐ฆฎ, ๐ ๐ช ๐ฒ ๐ถ ๐ ๐.
+
+ ๐ฅ ๐ โช ๐ญ ๐ ๐ ๐ช ๐ ๐ ๐ ๐, ๐ฃ ๐.
+
+๐ค ๐ผ ๐โ ๐ ๐ช ๐ช ๐ ๐ ๐ ๐.
+
+๐ ๐ ๐ ๐ ๐ โ.
+
+## ๐ ๐ ๏ธ
+
+๐ (๐ข) ๐ ๏ธ, โฉ.
+
+`FastAPI` ๐ธ (๐) โ๏ธ `.openapi()` ๐ฉโ๐ฌ ๐ ๐ ๐จ ๐ ๐.
+
+๐ ๐ธ ๐ ๐, *โก ๐ ๏ธ* `/openapi.json` (โ๏ธ โซ๏ธโ ๐ โ ๐ `openapi_url`) ยฎ.
+
+โซ๏ธ ๐จ ๐ป ๐จ โฎ๏ธ ๐ ๐ธ `.openapi()` ๐ฉโ๐ฌ.
+
+๐ข, โซ๏ธโ ๐ฉโ๐ฌ `.openapi()` ๐จ โ
๐ `.openapi_schema` ๐ ๐ฅ โซ๏ธ โ๏ธ ๐ & ๐จ ๐ซ.
+
+๐ฅ โซ๏ธ ๐ซ, โซ๏ธ ๐ ๐ซ โ๏ธ ๐ ๐ข `fastapi.openapi.utils.get_openapi`.
+
+& ๐ ๐ข `get_openapi()` ๐จ ๐ข:
+
+* `title`: ๐ ๐, ๐ฆ ๐ฉบ.
+* `version`: โฌ ๐ ๐ ๏ธ, โ
`2.5.0`.
+* `openapi_version`: โฌ ๐ ๐ง โ๏ธ. ๐ข, โช: `3.0.2`.
+* `description`: ๐ ๐ ๐ ๏ธ.
+* `routes`: ๐ ๐ฃ, ๐ซ ๐ ยฎ *โก ๐ ๏ธ*. ๐ซ โ โช๏ธโก๏ธ `app.routes`.
+
+## ๐ ๐ข
+
+โ๏ธ โน ๐, ๐ ๐ช โ๏ธ ๐ ๐ ๐ข ๐ ๐ ๐ & ๐ ๐ ๐ ๐ ๐ ๐ช.
+
+๐ผ, โก๏ธ ๐ฎ ๐ ๐ โ ๐ ๐ ๐ฑ.
+
+### ๐ **FastAPI**
+
+๐ฅ, โ ๐ ๐ **FastAPI** ๐ธ ๐:
+
+```Python hl_lines="1 4 7-9"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### ๐ ๐ ๐
+
+โคด๏ธ, โ๏ธ ๐ ๐ ๐ข ๐ ๐ ๐, ๐ `custom_openapi()` ๐ข:
+
+```Python hl_lines="2 15-20"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### ๐ ๐ ๐
+
+๐ ๐ ๐ช ๐ฎ ๐ โ, โ ๐ `x-logo` `info` "๐" ๐ ๐:
+
+```Python hl_lines="21-23"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### ๐พ ๐ ๐
+
+๐ ๐ช โ๏ธ ๐ `.openapi_schema` "๐พ", ๐ช ๐ ๐ ๐.
+
+๐ ๐, ๐ ๐ธ ๐ ๐ซ โ๏ธ ๐ ๐ ๐ ๐ฐ ๐ฉโ๐ป ๐ ๐ ๐ ๏ธ ๐ฉบ.
+
+โซ๏ธ ๐ ๐ ๐ด ๐, & โคด๏ธ ๐ ๐พ ๐ ๐ โ๏ธ โญ ๐จ.
+
+```Python hl_lines="13-14 24-25"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### ๐ ๐ฉโ๐ฌ
+
+๐ ๐ ๐ช โ `.openapi()` ๐ฉโ๐ฌ โฎ๏ธ ๐ ๐ ๐ข.
+
+```Python hl_lines="28"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### โ
โซ๏ธ
+
+๐ ๐ ๐ถ http://127.0.0.1:8000/redoc ๐ ๐ ๐ ๐ ๐ โ๏ธ ๐ ๐ ๐ฑ (๐ ๐ผ, **FastAPI**'โ ๐ฑ):
+
+
diff --git a/docs/em/docs/advanced/graphql.md b/docs/em/docs/how-to/graphql.md
similarity index 100%
rename from docs/em/docs/advanced/graphql.md
rename to docs/em/docs/how-to/graphql.md
diff --git a/docs/em/docs/advanced/sql-databases-peewee.md b/docs/em/docs/how-to/sql-databases-peewee.md
similarity index 100%
rename from docs/em/docs/advanced/sql-databases-peewee.md
rename to docs/em/docs/how-to/sql-databases-peewee.md
diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml
index 6d9119520..0d9597f07 100644
--- a/docs/en/data/sponsors.yml
+++ b/docs/en/data/sponsors.yml
@@ -33,6 +33,9 @@ silver:
- url: https://databento.com/
title: Pay as you go for market data
img: https://fastapi.tiangolo.com/img/sponsors/databento.svg
+ - url: https://speakeasyapi.dev?utm_source=fastapi+repo&utm_medium=github+sponsorship
+ title: SDKs for your API | Speakeasy
+ img: https://fastapi.tiangolo.com/img/sponsors/speakeasy.png
bronze:
- url: https://www.exoflare.com/open-source/?utm_source=FastAPI&utm_campaign=open_source
title: Biosecurity risk assessments made easy.
diff --git a/docs/en/data/sponsors_badge.yml b/docs/en/data/sponsors_badge.yml
index 7c3bb2f47..7b605e0ff 100644
--- a/docs/en/data/sponsors_badge.yml
+++ b/docs/en/data/sponsors_badge.yml
@@ -19,3 +19,4 @@ logins:
- Flint-company
- porter-dev
- fern-api
+ - ndimares
diff --git a/docs/en/docs/advanced/extending-openapi.md b/docs/en/docs/advanced/extending-openapi.md
deleted file mode 100644
index bec184dee..000000000
--- a/docs/en/docs/advanced/extending-openapi.md
+++ /dev/null
@@ -1,318 +0,0 @@
-# Extending OpenAPI
-
-!!! warning
- This is a rather advanced feature. You probably can skip it.
-
- If you are just following the tutorial - user guide, you can probably skip this section.
-
- If you already know that you need to modify the generated OpenAPI schema, continue reading.
-
-There are some cases where you might need to modify the generated OpenAPI schema.
-
-In this section you will see how.
-
-## The normal process
-
-The normal (default) process, is as follows.
-
-A `FastAPI` application (instance) has an `.openapi()` method that is expected to return the OpenAPI schema.
-
-As part of the application object creation, a *path operation* for `/openapi.json` (or for whatever you set your `openapi_url`) is registered.
-
-It just returns a JSON response with the result of the application's `.openapi()` method.
-
-By default, what the method `.openapi()` does is check the property `.openapi_schema` to see if it has contents and return them.
-
-If it doesn't, it generates them using the utility function at `fastapi.openapi.utils.get_openapi`.
-
-And that function `get_openapi()` receives as parameters:
-
-* `title`: The OpenAPI title, shown in the docs.
-* `version`: The version of your API, e.g. `2.5.0`.
-* `openapi_version`: The version of the OpenAPI specification used. By default, the latest: `3.1.0`.
-* `summary`: A short summary of the API.
-* `description`: The description of your API, this can include markdown and will be shown in the docs.
-* `routes`: A list of routes, these are each of the registered *path operations*. They are taken from `app.routes`.
-
-!!! info
- The parameter `summary` is available in OpenAPI 3.1.0 and above, supported by FastAPI 0.99.0 and above.
-
-## Overriding the defaults
-
-Using the information above, you can use the same utility function to generate the OpenAPI schema and override each part that you need.
-
-For example, let's add ReDoc's OpenAPI extension to include a custom logo.
-
-### Normal **FastAPI**
-
-First, write all your **FastAPI** application as normally:
-
-```Python hl_lines="1 4 7-9"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### Generate the OpenAPI schema
-
-Then, use the same utility function to generate the OpenAPI schema, inside a `custom_openapi()` function:
-
-```Python hl_lines="2 15-21"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### Modify the OpenAPI schema
-
-Now you can add the ReDoc extension, adding a custom `x-logo` to the `info` "object" in the OpenAPI schema:
-
-```Python hl_lines="22-24"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### Cache the OpenAPI schema
-
-You can use the property `.openapi_schema` as a "cache", to store your generated schema.
-
-That way, your application won't have to generate the schema every time a user opens your API docs.
-
-It will be generated only once, and then the same cached schema will be used for the next requests.
-
-```Python hl_lines="13-14 25-26"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### Override the method
-
-Now you can replace the `.openapi()` method with your new function.
-
-```Python hl_lines="29"
-{!../../../docs_src/extending_openapi/tutorial001.py!}
-```
-
-### Check it
-
-Once you go to http://127.0.0.1:8000/redoc you will see that you are using your custom logo (in this example, **FastAPI**'s logo):
-
-
-
-## Self-hosting JavaScript and CSS for docs
-
-The API docs use **Swagger UI** and **ReDoc**, and each of those need some JavaScript and CSS files.
-
-By default, those files are served from a CDN.
-
-But it's possible to customize it, you can set a specific CDN, or serve the files yourself.
-
-That's useful, for example, if you need your app to keep working even while offline, without open Internet access, or in a local network.
-
-Here you'll see how to serve those files yourself, in the same FastAPI app, and configure the docs to use them.
-
-### Project file structure
-
-Let's say your project file structure looks like this:
-
-```
-.
-โโโ app
-โ โโโ __init__.py
-โ โโโ main.py
-```
-
-Now create a directory to store those static files.
-
-Your new file structure could look like this:
-
-```
-.
-โโโ app
-โย ย โโโ __init__.py
-โย ย โโโ main.py
-โโโ static/
-```
-
-### Download the files
-
-Download the static files needed for the docs and put them on that `static/` directory.
-
-You can probably right-click each link and select an option similar to `Save link as...`.
-
-**Swagger UI** uses the files:
-
-* `swagger-ui-bundle.js`
-* `swagger-ui.css`
-
-And **ReDoc** uses the file:
-
-* `redoc.standalone.js`
-
-After that, your file structure could look like:
-
-```
-.
-โโโ app
-โย ย โโโ __init__.py
-โย ย โโโ main.py
-โโโ static
- โโโ redoc.standalone.js
- โโโ swagger-ui-bundle.js
- โโโ swagger-ui.css
-```
-
-### Serve the static files
-
-* Import `StaticFiles`.
-* "Mount" a `StaticFiles()` instance in a specific path.
-
-```Python hl_lines="7 11"
-{!../../../docs_src/extending_openapi/tutorial002.py!}
-```
-
-### Test the static files
-
-Start your application and go to http://127.0.0.1:8000/static/redoc.standalone.js.
-
-You should see a very long JavaScript file for **ReDoc**.
-
-It could start with something like:
-
-```JavaScript
-/*!
- * ReDoc - OpenAPI/Swagger-generated API Reference Documentation
- * -------------------------------------------------------------
- * Version: "2.0.0-rc.18"
- * Repo: https://github.com/Redocly/redoc
- */
-!function(e,t){"object"==typeof exports&&"object"==typeof m
-
-...
-```
-
-That confirms that you are being able to serve static files from your app, and that you placed the static files for the docs in the correct place.
-
-Now we can configure the app to use those static files for the docs.
-
-### Disable the automatic docs
-
-The first step is to disable the automatic docs, as those use the CDN by default.
-
-To disable them, set their URLs to `None` when creating your `FastAPI` app:
-
-```Python hl_lines="9"
-{!../../../docs_src/extending_openapi/tutorial002.py!}
-```
-
-### Include the custom docs
-
-Now you can create the *path operations* for the custom docs.
-
-You can re-use FastAPI's internal functions to create the HTML pages for the docs, and pass them the needed arguments:
-
-* `openapi_url`: the URL where the HTML page for the docs can get the OpenAPI schema for your API. You can use here the attribute `app.openapi_url`.
-* `title`: the title of your API.
-* `oauth2_redirect_url`: you can use `app.swagger_ui_oauth2_redirect_url` here to use the default.
-* `swagger_js_url`: the URL where the HTML for your Swagger UI docs can get the **JavaScript** file. This is the one that your own app is now serving.
-* `swagger_css_url`: the URL where the HTML for your Swagger UI docs can get the **CSS** file. This is the one that your own app is now serving.
-
-And similarly for ReDoc...
-
-```Python hl_lines="2-6 14-22 25-27 30-36"
-{!../../../docs_src/extending_openapi/tutorial002.py!}
-```
-
-!!! tip
- The *path operation* for `swagger_ui_redirect` is a helper for when you use OAuth2.
-
- If you integrate your API with an OAuth2 provider, you will be able to authenticate and come back to the API docs with the acquired credentials. And interact with it using the real OAuth2 authentication.
-
- Swagger UI will handle it behind the scenes for you, but it needs this "redirect" helper.
-
-### Create a *path operation* to test it
-
-Now, to be able to test that everything works, create a *path operation*:
-
-```Python hl_lines="39-41"
-{!../../../docs_src/extending_openapi/tutorial002.py!}
-```
-
-### Test it
-
-Now, you should be able to disconnect your WiFi, go to your docs at http://127.0.0.1:8000/docs, and reload the page.
-
-And even without Internet, you would be able to see the docs for your API and interact with it.
-
-## Configuring Swagger UI
-
-You can configure some extra Swagger UI parameters.
-
-To configure them, pass the `swagger_ui_parameters` argument when creating the `FastAPI()` app object or to the `get_swagger_ui_html()` function.
-
-`swagger_ui_parameters` receives a dictionary with the configurations passed to Swagger UI directly.
-
-FastAPI converts the configurations to **JSON** to make them compatible with JavaScript, as that's what Swagger UI needs.
-
-### Disable Syntax Highlighting
-
-For example, you could disable syntax highlighting in Swagger UI.
-
-Without changing the settings, syntax highlighting is enabled by default:
-
-
-
-But you can disable it by setting `syntaxHighlight` to `False`:
-
-```Python hl_lines="3"
-{!../../../docs_src/extending_openapi/tutorial003.py!}
-```
-
-...and then Swagger UI won't show the syntax highlighting anymore:
-
-
-
-### Change the Theme
-
-The same way you could set the syntax highlighting theme with the key `"syntaxHighlight.theme"` (notice that it has a dot in the middle):
-
-```Python hl_lines="3"
-{!../../../docs_src/extending_openapi/tutorial004.py!}
-```
-
-That configuration would change the syntax highlighting color theme:
-
-
-
-### Change Default Swagger UI Parameters
-
-FastAPI includes some default configuration parameters appropriate for most of the use cases.
-
-It includes these default configurations:
-
-```Python
-{!../../../fastapi/openapi/docs.py[ln:7-13]!}
-```
-
-You can override any of them by setting a different value in the argument `swagger_ui_parameters`.
-
-For example, to disable `deepLinking` you could pass these settings to `swagger_ui_parameters`:
-
-```Python hl_lines="3"
-{!../../../docs_src/extending_openapi/tutorial005.py!}
-```
-
-### Other Swagger UI Parameters
-
-To see all the other possible configurations you can use, read the official docs for Swagger UI parameters.
-
-### JavaScript-only settings
-
-Swagger UI also allows other configurations to be **JavaScript-only** objects (for example, JavaScript functions).
-
-FastAPI also includes these JavaScript-only `presets` settings:
-
-```JavaScript
-presets: [
- SwaggerUIBundle.presets.apis,
- SwaggerUIBundle.SwaggerUIStandalonePreset
-]
-```
-
-These are **JavaScript** objects, not strings, so you can't pass them from Python code directly.
-
-If you need to use JavaScript-only configurations like those, you can use one of the methods above. Override all the Swagger UI *path operation* and manually write any JavaScript you need.
diff --git a/docs/en/docs/advanced/generate-clients.md b/docs/en/docs/advanced/generate-clients.md
index 3fed48b0b..f439ed93a 100644
--- a/docs/en/docs/advanced/generate-clients.md
+++ b/docs/en/docs/advanced/generate-clients.md
@@ -12,10 +12,18 @@ A common tool is openapi-typescript-codegen.
-Another option you could consider for several languages is Fern.
+## Client and SDK Generators - Sponsor
-!!! info
- Fern is also a FastAPI sponsor. ๐๐
+There are also some **company-backed** Client and SDK generators based on OpenAPI (FastAPI), in some cases they can offer you **additional features** on top of high-quality generated SDKs/clients.
+
+Some of them also โจ [**sponsor FastAPI**](../help-fastapi.md#sponsor-the-author){.internal-link target=_blank} โจ, this ensures the continued and healthy **development** of FastAPI and its **ecosystem**.
+
+And it shows their true commitment to FastAPI and its **community** (you), as they not only want to provide you a **good service** but also want to make sure you have a **good and healthy framework**, FastAPI. ๐
+
+You might want to try their services and follow their guides:
+
+* Fern
+* Speakeasy
## Generate a TypeScript Frontend Client
diff --git a/docs/en/docs/advanced/index.md b/docs/en/docs/advanced/index.md
index 467f0833e..d8dcd4ca6 100644
--- a/docs/en/docs/advanced/index.md
+++ b/docs/en/docs/advanced/index.md
@@ -17,8 +17,17 @@ You could still use most of the features in **FastAPI** with the knowledge from
And the next sections assume you already read it, and assume that you know those main ideas.
-## TestDriven.io course
+## External Courses
-If you would like to take an advanced-beginner course to complement this section of the docs, you might want to check: Test-Driven Development with FastAPI and Docker by **TestDriven.io**.
+Although the [Tutorial - User Guide](../tutorial/){.internal-link target=_blank} and this **Advanced User Guide** are written as a guided tutorial (like a book) and should be enough for you to **learn FastAPI**, you might want to complement it with additional courses.
-They are currently donating 10% of all profits to the development of **FastAPI**. ๐ ๐
+Or it might be the case that you just prefer to take other courses because they adapt better to your learning style.
+
+Some course providers โจ [**sponsor FastAPI**](../help-fastapi.md#sponsor-the-author){.internal-link target=_blank} โจ, this ensures the continued and healthy **development** of FastAPI and its **ecosystem**.
+
+And it shows their true commitment to FastAPI and its **community** (you), as they not only want to provide you a **good learning experience** but also want to make sure you have a **good and healthy framework**, FastAPI. ๐
+
+You might want to try their courses:
+
+* Talk Python Training
+* Test-Driven Development
diff --git a/docs/en/docs/deployment/cloud.md b/docs/en/docs/deployment/cloud.md
new file mode 100644
index 000000000..b2836aeb4
--- /dev/null
+++ b/docs/en/docs/deployment/cloud.md
@@ -0,0 +1,17 @@
+# Deploy FastAPI on Cloud Providers
+
+You can use virtually **any cloud provider** to deploy your FastAPI application.
+
+In most of the cases, the main cloud providers have guides to deploy FastAPI with them.
+
+## Cloud Providers - Sponsors
+
+Some cloud providers โจ [**sponsor FastAPI**](../help-fastapi.md#sponsor-the-author){.internal-link target=_blank} โจ, this ensures the continued and healthy **development** of FastAPI and its **ecosystem**.
+
+And it shows their true commitment to FastAPI and its **community** (you), as they not only want to provide you a **good service** but also want to make sure you have a **good and healthy framework**, FastAPI. ๐
+
+You might want to try their services and follow their guides:
+
+* Platform.sh
+* Porter
+* Deta
diff --git a/docs/en/docs/deployment/deta.md b/docs/en/docs/deployment/deta.md
deleted file mode 100644
index 229d7fd5d..000000000
--- a/docs/en/docs/deployment/deta.md
+++ /dev/null
@@ -1,391 +0,0 @@
-# Deploy FastAPI on Deta Space
-
-In this section you will learn how to easily deploy a **FastAPI** application on Deta Space, for free. ๐
-
-It will take you about **10 minutes** to deploy an API that you can use. After that, you can optionally release it to anyone.
-
-Let's dive in.
-
-!!! info
- Deta is a **FastAPI** sponsor. ๐
-
-## A simple **FastAPI** app
-
-* To start, create an empty directory with the name of your app, for example `./fastapi-deta/`, and then navigate into it.
-
-```console
-$ mkdir fastapi-deta
-$ cd fastapi-deta
-```
-
-### FastAPI code
-
-* Create a `main.py` file with:
-
-```Python
-from fastapi import FastAPI
-
-app = FastAPI()
-
-
-@app.get("/")
-def read_root():
- return {"Hello": "World"}
-
-
-@app.get("/items/{item_id}")
-def read_item(item_id: int):
- return {"item_id": item_id}
-```
-
-### Requirements
-
-Now, in the same directory create a file `requirements.txt` with:
-
-```text
-fastapi
-uvicorn[standard]
-```
-
-### Directory structure
-
-You will now have a directory `./fastapi-deta/` with two files:
-
-```
-.
-โโโ main.py
-โโโ requirements.txt
-```
-
-## Create a free **Deta Space** account
-
-Next, create a free account on Deta Space, you just need an email and password.
-
-You don't even need a credit card, but make sure **Developer Mode** is enabled when you sign up.
-
-
-## Install the CLI
-
-Once you have your account, install the Deta Space CLI:
-
-=== "Linux, macOS"
-
-
-
- ```console
- $ curl -fsSL https://get.deta.dev/space-cli.sh | sh
- ```
-
-
-
-=== "Windows PowerShell"
-
-
-
- ```console
- $ iwr https://get.deta.dev/space-cli.ps1 -useb | iex
- ```
-
-
-
-After installing it, open a new terminal so that the installed CLI is detected.
-
-In a new terminal, confirm that it was correctly installed with:
-
-
-
-```console
-$ space --help
-
-Deta command line interface for managing deta micros.
-Complete documentation available at https://deta.space/docs
-
-Usage:
- space [flags]
- space [command]
-
-Available Commands:
- help Help about any command
- link link code to project
- login login to space
- new create new project
- push push code for project
- release create release for a project
- validate validate spacefile in dir
- version Space CLI version
-...
-```
-
-
-
-!!! tip
- If you have problems installing the CLI, check the official Deta Space Documentation.
-
-## Login with the CLI
-
-In order to authenticate your CLI with Deta Space, you will need an access token.
-
-To obtain this token, open your Deta Space Canvas, open the **Teletype** (command bar at the bottom of the Canvas), and then click on **Settings**. From there, select **Generate Token** and copy the resulting token.
-
-
-
-Now run `space login` from the Space CLI. Upon pasting the token into the CLI prompt and pressing enter, you should see a confirmation message.
-
-
-
-```console
-$ space login
-
-To authenticate the Space CLI with your Space account, generate a new access token in your Space settings and paste it below:
-
-# Enter access token (41 chars) >$ *****************************************
-
-๐ Login Successful!
-```
-
-
-
-## Create a new project in Space
-
-Now that you've authenticated with the Space CLI, use it to create a new Space Project:
-
-```console
-$ space new
-
-# What is your project's name? >$ fastapi-deta
-```
-
-The Space CLI will ask you to name the project, we will call ours `fastapi-deta`.
-
-Then, it will try to automatically detect which framework or language you are using, showing you what it finds. In our case it will identify the Python app with the following message, prompting you to confirm:
-
-```console
-โ๏ธ No Spacefile found, trying to auto-detect configuration ...
-๐ Deta detected the following configuration:
-
-Micros:
-name: fastapi-deta
- L src: .
- L engine: python3.9
-
-# Do you want to bootstrap "fastapi-deta" with this configuration? (y/n)$ y
-```
-
-After you confirm, your project will be created in Deta Space inside a special app called Builder. Builder is a toolbox that helps you to create and manage your apps in Deta Space.
-
-The CLI will also create a `Spacefile` locally in the `fastapi-deta` directory. The Spacefile is a configuration file which tells Deta Space how to run your app. The `Spacefile` for your app will be as follows:
-
-```yaml
-v: 0
-micros:
- - name: fastapi-deta
- src: .
- engine: python3.9
-```
-
-It is a `yaml` file, and you can use it to add features like scheduled tasks or modify how your app functions, which we'll do later. To learn more, read the `Spacefile` documentation.
-
-!!! tip
- The Space CLI will also create a hidden `.space` folder in your local directory to link your local environment with Deta Space. This folder should not be included in your version control and will automatically be added to your `.gitignore` file, if you have initialized a Git repository.
-
-## Define the run command in the Spacefile
-
-The `run` command in the Spacefile tells Space what command should be executed to start your app. In this case it would be `uvicorn main:app`.
-
-```diff
-v: 0
-micros:
- - name: fastapi-deta
- src: .
- engine: python3.9
-+ run: uvicorn main:app
-```
-
-## Deploy to Deta Space
-
-To get your FastAPI live in the cloud, use one more CLI command:
-
-
-
-```console
-$ space push
-
----> 100%
-
-build complete... created revision: satyr-jvjk
-
-โ Successfully pushed your code and created a new Revision!
-โน Updating your development instance with the latest Revision, it will be available on your Canvas shortly.
-```
-
-
-This command will package your code, upload all the necessary files to Deta Space, and run a remote build of your app, resulting in a **revision**. Whenever you run `space push` successfully, a live instance of your API is automatically updated with the latest revision.
-
-!!! tip
- You can manage your revisions by opening your project in the Builder app. The live copy of your API will be visible under the **Develop** tab in Builder.
-
-## Check it
-
-The live instance of your API will also be added automatically to your Canvas (the dashboard) on Deta Space.
-
-
-
-Click on the new app called `fastapi-deta`, and it will open your API in a new browser tab on a URL like `https://fastapi-deta-gj7ka8.deta.app/`.
-
-You will get a JSON response from your FastAPI app:
-
-```JSON
-{
- "Hello": "World"
-}
-```
-
-And now you can head over to the `/docs` of your API. For this example, it would be `https://fastapi-deta-gj7ka8.deta.app/docs`.
-
-
-
-## Enable public access
-
-Deta will handle authentication for your account using cookies. By default, every app or API that you `push` or install to your Space is personal - it's only accessible to you.
-
-But you can also make your API public using the `Spacefile` from earlier.
-
-With a `public_routes` parameter, you can specify which paths of your API should be available to the public.
-
-Set your `public_routes` to `"*"` to open every route of your API to the public:
-
-```yaml
-v: 0
-micros:
- - name: fastapi-deta
- src: .
- engine: python3.9
- public_routes:
- - "/*"
-```
-
-Then run `space push` again to update your live API on Deta Space.
-
-Once it deploys, you can share your URL with anyone and they will be able to access your API. ๐
-
-## HTTPS
-
-Congrats! You deployed your FastAPI app to Deta Space! ๐ ๐ฐ
-
-Also, notice that Deta Space correctly handles HTTPS for you, so you don't have to take care of that and can be sure that your users will have a secure encrypted connection. โ
๐
-
-## Create a release
-
-Space also allows you to publish your API. When you publish it, anyone else can install their own copy of your API, in their own Deta Space cloud.
-
-To do so, run `space release` in the Space CLI to create an **unlisted release**:
-
-
-
-```console
-$ space release
-
-# Do you want to use the latest revision (buzzard-hczt)? (y/n)$ y
-
-~ Creating a Release with the latest Revision
-
----> 100%
-
-creating release...
-publishing release in edge locations..
-completed...
-released: fastapi-deta-exp-msbu
-https://deta.space/discovery/r/5kjhgyxewkdmtotx
-
- Lift off -- successfully created a new Release!
- Your Release is available globally on 5 Deta Edges
- Anyone can install their own copy of your app.
-```
-
-
-This command publishes your revision as a release and gives you a link. Anyone you give this link to can install your API.
-
-
-You can also make your app publicly discoverable by creating a **listed release** with `space release --listed` in the Space CLI:
-
-
-
-```console
-$ space release --listed
-
-# Do you want to use the latest revision (buzzard-hczt)? (y/n)$ y
-
-~ Creating a listed Release with the latest Revision ...
-
-creating release...
-publishing release in edge locations..
-completed...
-released: fastapi-deta-exp-msbu
-https://deta.space/discovery/@user/fastapi-deta
-
- Lift off -- successfully created a new Release!
- Your Release is available globally on 5 Deta Edges
- Anyone can install their own copy of your app.
- Listed on Discovery for others to find!
-```
-
-
-This will allow anyone to find and install your app via Deta Discovery. Read more about releasing your app in the docs.
-
-## Check runtime logs
-
-Deta Space also lets you inspect the logs of every app you build or install.
-
-Add some logging functionality to your app by adding a `print` statement to your `main.py` file.
-
-```py
-from fastapi import FastAPI
-
-app = FastAPI()
-
-
-@app.get("/")
-def read_root():
- return {"Hello": "World"}
-
-
-@app.get("/items/{item_id}")
-def read_item(item_id: int):
- print(item_id)
- return {"item_id": item_id}
-```
-
-The code within the `read_item` function includes a print statement that will output the `item_id` that is included in the URL. Send a request to your _path operation_ `/items/{item_id}` from the docs UI (which will have a URL like `https://fastapi-deta-gj7ka8.deta.app/docs`), using an ID like `5` as an example.
-
-Now go to your Space's Canvas. Click on the context menu (`...`) of your live app instance, and then click on **View Logs**. Here you can view your app's logs, sorted by time.
-
-
-
-## 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 and Deta Drive, both of which have a generous **free tier**.
-
-You can also read more in the Deta Space Documentation.
-
-!!! tip
- If you have any Deta related questions, comments, or feedback, head to the Deta Discord server.
-
-
-## Deployment Concepts
-
-Coming back to the concepts we discussed in [Deployments Concepts](./concepts.md){.internal-link target=_blank}, here's how each of them would be handled with Deta Space:
-
-- **HTTPS**: Handled by Deta Space, they will give you a subdomain and handle HTTPS automatically.
-- **Running on startup**: Handled by Deta Space, as part of their service.
-- **Restarts**: Handled by Deta Space, as part of their service.
-- **Replication**: Handled by Deta Space, as part of their service.
-- **Authentication**: Handled by Deta Space, as part of their service.
-- **Memory**: Limit predefined by Deta Space, you could contact them to increase it.
-- **Previous steps before starting**: Can be configured using the `Spacefile`.
-
-!!! note
- Deta Space is designed to make it easy and free to build cloud applications for yourself. Then you can optionally share them with anyone.
-
- 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 Space Documentation to see if it's the right choice for you.
diff --git a/docs/en/docs/advanced/async-sql-databases.md b/docs/en/docs/how-to/async-sql-encode-databases.md
similarity index 98%
rename from docs/en/docs/advanced/async-sql-databases.md
rename to docs/en/docs/how-to/async-sql-encode-databases.md
index 12549a190..697167f79 100644
--- a/docs/en/docs/advanced/async-sql-databases.md
+++ b/docs/en/docs/how-to/async-sql-encode-databases.md
@@ -1,4 +1,4 @@
-# Async SQL (Relational) Databases
+# Async SQL (Relational) Databases with Encode/Databases
!!! info
These docs are about to be updated. ๐
diff --git a/docs/en/docs/advanced/conditional-openapi.md b/docs/en/docs/how-to/conditional-openapi.md
similarity index 100%
rename from docs/en/docs/advanced/conditional-openapi.md
rename to docs/en/docs/how-to/conditional-openapi.md
diff --git a/docs/en/docs/how-to/configure-swagger-ui.md b/docs/en/docs/how-to/configure-swagger-ui.md
new file mode 100644
index 000000000..f36ba5ba8
--- /dev/null
+++ b/docs/en/docs/how-to/configure-swagger-ui.md
@@ -0,0 +1,78 @@
+# Configure Swagger UI
+
+You can configure some extra Swagger UI parameters.
+
+To configure them, pass the `swagger_ui_parameters` argument when creating the `FastAPI()` app object or to the `get_swagger_ui_html()` function.
+
+`swagger_ui_parameters` receives a dictionary with the configurations passed to Swagger UI directly.
+
+FastAPI converts the configurations to **JSON** to make them compatible with JavaScript, as that's what Swagger UI needs.
+
+## Disable Syntax Highlighting
+
+For example, you could disable syntax highlighting in Swagger UI.
+
+Without changing the settings, syntax highlighting is enabled by default:
+
+
+
+But you can disable it by setting `syntaxHighlight` to `False`:
+
+```Python hl_lines="3"
+{!../../../docs_src/configure_swagger_ui/tutorial001.py!}
+```
+
+...and then Swagger UI won't show the syntax highlighting anymore:
+
+
+
+## Change the Theme
+
+The same way you could set the syntax highlighting theme with the key `"syntaxHighlight.theme"` (notice that it has a dot in the middle):
+
+```Python hl_lines="3"
+{!../../../docs_src/configure_swagger_ui/tutorial002.py!}
+```
+
+That configuration would change the syntax highlighting color theme:
+
+
+
+## Change Default Swagger UI Parameters
+
+FastAPI includes some default configuration parameters appropriate for most of the use cases.
+
+It includes these default configurations:
+
+```Python
+{!../../../fastapi/openapi/docs.py[ln:7-13]!}
+```
+
+You can override any of them by setting a different value in the argument `swagger_ui_parameters`.
+
+For example, to disable `deepLinking` you could pass these settings to `swagger_ui_parameters`:
+
+```Python hl_lines="3"
+{!../../../docs_src/configure_swagger_ui/tutorial003.py!}
+```
+
+## Other Swagger UI Parameters
+
+To see all the other possible configurations you can use, read the official docs for Swagger UI parameters.
+
+## JavaScript-only settings
+
+Swagger UI also allows other configurations to be **JavaScript-only** objects (for example, JavaScript functions).
+
+FastAPI also includes these JavaScript-only `presets` settings:
+
+```JavaScript
+presets: [
+ SwaggerUIBundle.presets.apis,
+ SwaggerUIBundle.SwaggerUIStandalonePreset
+]
+```
+
+These are **JavaScript** objects, not strings, so you can't pass them from Python code directly.
+
+If you need to use JavaScript-only configurations like those, you can use one of the methods above. Override all the Swagger UI *path operation* and manually write any JavaScript you need.
diff --git a/docs/en/docs/how-to/custom-docs-ui-assets.md b/docs/en/docs/how-to/custom-docs-ui-assets.md
new file mode 100644
index 000000000..f26324869
--- /dev/null
+++ b/docs/en/docs/how-to/custom-docs-ui-assets.md
@@ -0,0 +1,199 @@
+# Custom Docs UI Static Assets (Self-Hosting)
+
+The API docs use **Swagger UI** and **ReDoc**, and each of those need some JavaScript and CSS files.
+
+By default, those files are served from a CDN.
+
+But it's possible to customize it, you can set a specific CDN, or serve the files yourself.
+
+## Custom CDN for JavaScript and CSS
+
+Let's say that you want to use a different CDN, for example you want to use `https://unpkg.com/`.
+
+This could be useful if for example you live in a country that restricts some URLs.
+
+### Disable the automatic docs
+
+The first step is to disable the automatic docs, as by default, those use the default CDN.
+
+To disable them, set their URLs to `None` when creating your `FastAPI` app:
+
+```Python hl_lines="8"
+{!../../../docs_src/custom_docs_ui/tutorial001.py!}
+```
+
+### Include the custom docs
+
+Now you can create the *path operations* for the custom docs.
+
+You can re-use FastAPI's internal functions to create the HTML pages for the docs, and pass them the needed arguments:
+
+* `openapi_url`: the URL where the HTML page for the docs can get the OpenAPI schema for your API. You can use here the attribute `app.openapi_url`.
+* `title`: the title of your API.
+* `oauth2_redirect_url`: you can use `app.swagger_ui_oauth2_redirect_url` here to use the default.
+* `swagger_js_url`: the URL where the HTML for your Swagger UI docs can get the **JavaScript** file. This is the custom CDN URL.
+* `swagger_css_url`: the URL where the HTML for your Swagger UI docs can get the **CSS** file. This is the custom CDN URL.
+
+And similarly for ReDoc...
+
+```Python hl_lines="2-6 11-19 22-24 27-33"
+{!../../../docs_src/custom_docs_ui/tutorial001.py!}
+```
+
+!!! tip
+ The *path operation* for `swagger_ui_redirect` is a helper for when you use OAuth2.
+
+ If you integrate your API with an OAuth2 provider, you will be able to authenticate and come back to the API docs with the acquired credentials. And interact with it using the real OAuth2 authentication.
+
+ Swagger UI will handle it behind the scenes for you, but it needs this "redirect" helper.
+
+### Create a *path operation* to test it
+
+Now, to be able to test that everything works, create a *path operation*:
+
+```Python hl_lines="36-38"
+{!../../../docs_src/custom_docs_ui/tutorial001.py!}
+```
+
+### Test it
+
+Now, you should be able to go to your docs at http://127.0.0.1:8000/docs, and reload the page, it will load those assets from the new CDN.
+
+## Self-hosting JavaScript and CSS for docs
+
+Self-hosting the JavaScript and CSS could be useful if, for example, you need your app to keep working even while offline, without open Internet access, or in a local network.
+
+Here you'll see how to serve those files yourself, in the same FastAPI app, and configure the docs to use them.
+
+### Project file structure
+
+Let's say your project file structure looks like this:
+
+```
+.
+โโโ app
+โ โโโ __init__.py
+โ โโโ main.py
+```
+
+Now create a directory to store those static files.
+
+Your new file structure could look like this:
+
+```
+.
+โโโ app
+โย ย โโโ __init__.py
+โย ย โโโ main.py
+โโโ static/
+```
+
+### Download the files
+
+Download the static files needed for the docs and put them on that `static/` directory.
+
+You can probably right-click each link and select an option similar to `Save link as...`.
+
+**Swagger UI** uses the files:
+
+* `swagger-ui-bundle.js`
+* `swagger-ui.css`
+
+And **ReDoc** uses the file:
+
+* `redoc.standalone.js`
+
+After that, your file structure could look like:
+
+```
+.
+โโโ app
+โย ย โโโ __init__.py
+โย ย โโโ main.py
+โโโ static
+ โโโ redoc.standalone.js
+ โโโ swagger-ui-bundle.js
+ โโโ swagger-ui.css
+```
+
+### Serve the static files
+
+* Import `StaticFiles`.
+* "Mount" a `StaticFiles()` instance in a specific path.
+
+```Python hl_lines="7 11"
+{!../../../docs_src/custom_docs_ui/tutorial002.py!}
+```
+
+### Test the static files
+
+Start your application and go to http://127.0.0.1:8000/static/redoc.standalone.js.
+
+You should see a very long JavaScript file for **ReDoc**.
+
+It could start with something like:
+
+```JavaScript
+/*!
+ * ReDoc - OpenAPI/Swagger-generated API Reference Documentation
+ * -------------------------------------------------------------
+ * Version: "2.0.0-rc.18"
+ * Repo: https://github.com/Redocly/redoc
+ */
+!function(e,t){"object"==typeof exports&&"object"==typeof m
+
+...
+```
+
+That confirms that you are being able to serve static files from your app, and that you placed the static files for the docs in the correct place.
+
+Now we can configure the app to use those static files for the docs.
+
+### Disable the automatic docs for static files
+
+The same as when using a custom CDN, the first step is to disable the automatic docs, as those use the CDN by default.
+
+To disable them, set their URLs to `None` when creating your `FastAPI` app:
+
+```Python hl_lines="9"
+{!../../../docs_src/custom_docs_ui/tutorial002.py!}
+```
+
+### Include the custom docs for static files
+
+And the same way as with a custom CDN, now you can create the *path operations* for the custom docs.
+
+Again, you can re-use FastAPI's internal functions to create the HTML pages for the docs, and pass them the needed arguments:
+
+* `openapi_url`: the URL where the HTML page for the docs can get the OpenAPI schema for your API. You can use here the attribute `app.openapi_url`.
+* `title`: the title of your API.
+* `oauth2_redirect_url`: you can use `app.swagger_ui_oauth2_redirect_url` here to use the default.
+* `swagger_js_url`: the URL where the HTML for your Swagger UI docs can get the **JavaScript** file. **This is the one that your own app is now serving**.
+* `swagger_css_url`: the URL where the HTML for your Swagger UI docs can get the **CSS** file. **This is the one that your own app is now serving**.
+
+And similarly for ReDoc...
+
+```Python hl_lines="2-6 14-22 25-27 30-36"
+{!../../../docs_src/custom_docs_ui/tutorial002.py!}
+```
+
+!!! tip
+ The *path operation* for `swagger_ui_redirect` is a helper for when you use OAuth2.
+
+ If you integrate your API with an OAuth2 provider, you will be able to authenticate and come back to the API docs with the acquired credentials. And interact with it using the real OAuth2 authentication.
+
+ Swagger UI will handle it behind the scenes for you, but it needs this "redirect" helper.
+
+### Create a *path operation* to test static files
+
+Now, to be able to test that everything works, create a *path operation*:
+
+```Python hl_lines="39-41"
+{!../../../docs_src/custom_docs_ui/tutorial002.py!}
+```
+
+### Test Static Files UI
+
+Now, you should be able to disconnect your WiFi, go to your docs at http://127.0.0.1:8000/docs, and reload the page.
+
+And even without Internet, you would be able to see the docs for your API and interact with it.
diff --git a/docs/en/docs/advanced/custom-request-and-route.md b/docs/en/docs/how-to/custom-request-and-route.md
similarity index 100%
rename from docs/en/docs/advanced/custom-request-and-route.md
rename to docs/en/docs/how-to/custom-request-and-route.md
diff --git a/docs/en/docs/how-to/extending-openapi.md b/docs/en/docs/how-to/extending-openapi.md
new file mode 100644
index 000000000..a18fd737e
--- /dev/null
+++ b/docs/en/docs/how-to/extending-openapi.md
@@ -0,0 +1,87 @@
+# Extending OpenAPI
+
+There are some cases where you might need to modify the generated OpenAPI schema.
+
+In this section you will see how.
+
+## The normal process
+
+The normal (default) process, is as follows.
+
+A `FastAPI` application (instance) has an `.openapi()` method that is expected to return the OpenAPI schema.
+
+As part of the application object creation, a *path operation* for `/openapi.json` (or for whatever you set your `openapi_url`) is registered.
+
+It just returns a JSON response with the result of the application's `.openapi()` method.
+
+By default, what the method `.openapi()` does is check the property `.openapi_schema` to see if it has contents and return them.
+
+If it doesn't, it generates them using the utility function at `fastapi.openapi.utils.get_openapi`.
+
+And that function `get_openapi()` receives as parameters:
+
+* `title`: The OpenAPI title, shown in the docs.
+* `version`: The version of your API, e.g. `2.5.0`.
+* `openapi_version`: The version of the OpenAPI specification used. By default, the latest: `3.1.0`.
+* `summary`: A short summary of the API.
+* `description`: The description of your API, this can include markdown and will be shown in the docs.
+* `routes`: A list of routes, these are each of the registered *path operations*. They are taken from `app.routes`.
+
+!!! info
+ The parameter `summary` is available in OpenAPI 3.1.0 and above, supported by FastAPI 0.99.0 and above.
+
+## Overriding the defaults
+
+Using the information above, you can use the same utility function to generate the OpenAPI schema and override each part that you need.
+
+For example, let's add ReDoc's OpenAPI extension to include a custom logo.
+
+### Normal **FastAPI**
+
+First, write all your **FastAPI** application as normally:
+
+```Python hl_lines="1 4 7-9"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Generate the OpenAPI schema
+
+Then, use the same utility function to generate the OpenAPI schema, inside a `custom_openapi()` function:
+
+```Python hl_lines="2 15-21"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Modify the OpenAPI schema
+
+Now you can add the ReDoc extension, adding a custom `x-logo` to the `info` "object" in the OpenAPI schema:
+
+```Python hl_lines="22-24"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Cache the OpenAPI schema
+
+You can use the property `.openapi_schema` as a "cache", to store your generated schema.
+
+That way, your application won't have to generate the schema every time a user opens your API docs.
+
+It will be generated only once, and then the same cached schema will be used for the next requests.
+
+```Python hl_lines="13-14 25-26"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Override the method
+
+Now you can replace the `.openapi()` method with your new function.
+
+```Python hl_lines="29"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Check it
+
+Once you go to http://127.0.0.1:8000/redoc you will see that you are using your custom logo (in this example, **FastAPI**'s logo):
+
+
diff --git a/docs/en/docs/how-to/general.md b/docs/en/docs/how-to/general.md
new file mode 100644
index 000000000..04367c6b7
--- /dev/null
+++ b/docs/en/docs/how-to/general.md
@@ -0,0 +1,39 @@
+# General - How To - Recipes
+
+Here are several pointers to other places in the docs, for general or frequent questions.
+
+## Filter Data - Security
+
+To ensure that you don't return more data than you should, read the docs for [Tutorial - Response Model - Return Type](../tutorial/response-model.md){.internal-link target=_blank}.
+
+## Documentation Tags - OpenAPI
+
+To add tags to your *path operations*, and group them in the docs UI, read the docs for [Tutorial - Path Operation Configurations - Tags](../tutorial/path-operation-configuration.md#tags){.internal-link target=_blank}.
+
+## Documentation Summary and Description - OpenAPI
+
+To add a summary and description to your *path operations*, and show them in the docs UI, read the docs for [Tutorial - Path Operation Configurations - Summary and Description](../tutorial/path-operation-configuration.md#summary-and-description){.internal-link target=_blank}.
+
+## Documentation Response description - OpenAPI
+
+To define the description of the response, shown in the docs UI, read the docs for [Tutorial - Path Operation Configurations - Response description](../tutorial/path-operation-configuration.md#response-description){.internal-link target=_blank}.
+
+## Documentation Deprecate a *Path Operation* - OpenAPI
+
+To deprecate a *path operation*, and show it in the docs UI, read the docs for [Tutorial - Path Operation Configurations - Deprecation](../tutorial/path-operation-configuration.md#deprecate-a-path-operation){.internal-link target=_blank}.
+
+## Convert any Data to JSON-compatible
+
+To convert any data to JSON-compatible, read the docs for [Tutorial - JSON Compatible Encoder](../tutorial/encoder.md){.internal-link target=_blank}.
+
+## OpenAPI Metadata - Docs
+
+To add metadata to your OpenAPI schema, including a license, version, contact, etc, read the docs for [Tutorial - Metadata and Docs URLs](../tutorial/metadata.md){.internal-link target=_blank}.
+
+## OpenAPI Custom URL
+
+To customize the OpenAPI URL (or remove it), read the docs for [Tutorial - Metadata and Docs URLs](../tutorial/metadata.md#openapi-url){.internal-link target=_blank}.
+
+## OpenAPI Docs URLs
+
+To update the URLs used for the automatically generated docs user interfaces, read the docs for [Tutorial - Metadata and Docs URLs](../tutorial/metadata.md#docs-urls){.internal-link target=_blank}.
diff --git a/docs/en/docs/advanced/graphql.md b/docs/en/docs/how-to/graphql.md
similarity index 100%
rename from docs/en/docs/advanced/graphql.md
rename to docs/en/docs/how-to/graphql.md
diff --git a/docs/en/docs/how-to/index.md b/docs/en/docs/how-to/index.md
new file mode 100644
index 000000000..ec7fd38f8
--- /dev/null
+++ b/docs/en/docs/how-to/index.md
@@ -0,0 +1,11 @@
+# How To - Recipes
+
+Here you will see different recipes or "how to" guides for **several topics**.
+
+Most of these ideas would be more or less **independent**, and in most cases you should only need to study them if they apply directly to **your project**.
+
+If something seems interesting and useful to your project, go ahead and check it, but otherwise, you might probably just skip them.
+
+!!! tip
+
+ If you want to **learn FastAPI** in a structured way (recommended), go and read the [Tutorial - User Guide](../tutorial/index.md){.internal-link target=_blank} chapter by chapter instead.
diff --git a/docs/en/docs/advanced/nosql-databases.md b/docs/en/docs/how-to/nosql-databases-couchbase.md
similarity index 99%
rename from docs/en/docs/advanced/nosql-databases.md
rename to docs/en/docs/how-to/nosql-databases-couchbase.md
index 606db35c7..ae6ad604b 100644
--- a/docs/en/docs/advanced/nosql-databases.md
+++ b/docs/en/docs/how-to/nosql-databases-couchbase.md
@@ -1,4 +1,4 @@
-# NoSQL (Distributed / Big Data) Databases
+# NoSQL (Distributed / Big Data) Databases with Couchbase
!!! info
These docs are about to be updated. ๐
diff --git a/docs/en/docs/advanced/sql-databases-peewee.md b/docs/en/docs/how-to/sql-databases-peewee.md
similarity index 99%
rename from docs/en/docs/advanced/sql-databases-peewee.md
rename to docs/en/docs/how-to/sql-databases-peewee.md
index 6a469634f..bf2f2e714 100644
--- a/docs/en/docs/advanced/sql-databases-peewee.md
+++ b/docs/en/docs/how-to/sql-databases-peewee.md
@@ -12,6 +12,8 @@
Because Pewee doesn't play well with anything async and there are better alternatives, I won't update these docs for Pydantic v2, they are kept for now only for historical purposes.
+ The examples here are no longer tested in CI (as they were before).
+
If you are starting a project from scratch, you are probably better off with SQLAlchemy ORM ([SQL (Relational) Databases](../tutorial/sql-databases.md){.internal-link target=_blank}), or any other async ORM.
If you already have a code base that uses Peewee ORM, you can check here how to use it with **FastAPI**.
diff --git a/docs/en/docs/img/sponsors/speakeasy.png b/docs/en/docs/img/sponsors/speakeasy.png
new file mode 100644
index 000000000..001b4b4ca
Binary files /dev/null and b/docs/en/docs/img/sponsors/speakeasy.png differ
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 868628ae8..61ec91b4a 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,19 +2,47 @@
## Latest Changes
-* ๐ Add Ukrainian translation for `docs/uk/docs/tutorial/cookie-params.md`. PR [#10032](https://github.com/tiangolo/fastapi/pull/10032) by [@rostik1410](https://github.com/rostik1410).
-* ๐ Add Russian translation for `docs/ru/docs/deployment/docker.md`. PR [#9971](https://github.com/tiangolo/fastapi/pull/9971) by [@Xewus](https://github.com/Xewus).
-* ๐ Add Vietnamese translation for `docs/vi/docs/python-types.md`. PR [#10047](https://github.com/tiangolo/fastapi/pull/10047) by [@magiskboy](https://github.com/magiskboy).
-* ๐ง Add sponsor Porter. PR [#10051](https://github.com/tiangolo/fastapi/pull/10051) by [@tiangolo](https://github.com/tiangolo).
-* ๐ง Update sponsors, add Jina back as bronze sponsor. PR [#10050](https://github.com/tiangolo/fastapi/pull/10050) by [@tiangolo](https://github.com/tiangolo).
+* ๐ Add new docs section, How To - Recipes, move docs that don't have to be read by everyone to How To. PR [#10114](https://github.com/tiangolo/fastapi/pull/10114) by [@tiangolo](https://github.com/tiangolo).
+* โป๏ธ Refactor tests for new Pydantic 2.2.1. PR [#10115](https://github.com/tiangolo/fastapi/pull/10115) by [@tiangolo](https://github.com/tiangolo).
+* ๐ Update Advanced docs, add links to sponsor courses. PR [#10113](https://github.com/tiangolo/fastapi/pull/10113) by [@tiangolo](https://github.com/tiangolo).
+* ๐ Update docs for generating clients. PR [#10112](https://github.com/tiangolo/fastapi/pull/10112) by [@tiangolo](https://github.com/tiangolo).
+* ๐ Tweak MkDocs and add redirects. PR [#10111](https://github.com/tiangolo/fastapi/pull/10111) by [@tiangolo](https://github.com/tiangolo).
+* ๐ Restructure docs for cloud providers, include links to sponsors. PR [#10110](https://github.com/tiangolo/fastapi/pull/10110) by [@tiangolo](https://github.com/tiangolo).
+* ๐ง Update sponsors, add Speakeasy. PR [#10098](https://github.com/tiangolo/fastapi/pull/10098) by [@tiangolo](https://github.com/tiangolo).
+## 0.101.1
+
+### Fixes
+
+* โจ Add `ResponseValidationError` printable details, to show up in server error logs. PR [#10078](https://github.com/tiangolo/fastapi/pull/10078) by [@tiangolo](https://github.com/tiangolo).
+
+### Refactors
+
* โ๏ธ Fix typo in deprecation warnings in `fastapi/params.py`. PR [#9854](https://github.com/tiangolo/fastapi/pull/9854) by [@russbiggs](https://github.com/russbiggs).
-* โ๏ธ Fix typo in release notes. PR [#9835](https://github.com/tiangolo/fastapi/pull/9835) by [@francisbergin](https://github.com/francisbergin).
* โ๏ธ Fix typos in comments on internal code in `fastapi/concurrency.py` and `fastapi/routing.py`. PR [#9590](https://github.com/tiangolo/fastapi/pull/9590) by [@ElliottLarsen](https://github.com/ElliottLarsen).
+
+### Docs
+
+* โ๏ธ Fix typo in release notes. PR [#9835](https://github.com/tiangolo/fastapi/pull/9835) by [@francisbergin](https://github.com/francisbergin).
* ๐ Add external article: Build an SMS Spam Classifier Serverless Database with FaunaDB and FastAPI. PR [#9847](https://github.com/tiangolo/fastapi/pull/9847) by [@adejumoridwan](https://github.com/adejumoridwan).
* ๐ Fix typo in `docs/en/docs/contributing.md`. PR [#9878](https://github.com/tiangolo/fastapi/pull/9878) by [@VicenteMerino](https://github.com/VicenteMerino).
* ๐ Fix code highlighting in `docs/en/docs/tutorial/bigger-applications.md`. PR [#9806](https://github.com/tiangolo/fastapi/pull/9806) by [@theonlykingpin](https://github.com/theonlykingpin).
+
+### Translations
+
+* ๐ Add Japanese translation for `docs/ja/docs/deployment/concepts.md`. PR [#10062](https://github.com/tiangolo/fastapi/pull/10062) by [@tamtam-fitness](https://github.com/tamtam-fitness).
+* ๐ Add Japanese translation for `docs/ja/docs/deployment/server-workers.md`. PR [#10064](https://github.com/tiangolo/fastapi/pull/10064) by [@tamtam-fitness](https://github.com/tamtam-fitness).
+* ๐ Update Japanese translation for `docs/ja/docs/deployment/docker.md`. PR [#10073](https://github.com/tiangolo/fastapi/pull/10073) by [@tamtam-fitness](https://github.com/tamtam-fitness).
+* ๐ Add Ukrainian translation for `docs/uk/docs/fastapi-people.md`. PR [#10059](https://github.com/tiangolo/fastapi/pull/10059) by [@rostik1410](https://github.com/rostik1410).
+* ๐ Add Ukrainian translation for `docs/uk/docs/tutorial/cookie-params.md`. PR [#10032](https://github.com/tiangolo/fastapi/pull/10032) by [@rostik1410](https://github.com/rostik1410).
+* ๐ Add Russian translation for `docs/ru/docs/deployment/docker.md`. PR [#9971](https://github.com/tiangolo/fastapi/pull/9971) by [@Xewus](https://github.com/Xewus).
+* ๐ Add Vietnamese translation for `docs/vi/docs/python-types.md`. PR [#10047](https://github.com/tiangolo/fastapi/pull/10047) by [@magiskboy](https://github.com/magiskboy).
* ๐ Add Russian translation for `docs/ru/docs/tutorial/dependencies/global-dependencies.md`. PR [#9970](https://github.com/tiangolo/fastapi/pull/9970) by [@dudyaosuplayer](https://github.com/dudyaosuplayer).
* ๐ Add Urdu translation for `docs/ur/docs/benchmarks.md`. PR [#9974](https://github.com/tiangolo/fastapi/pull/9974) by [@AhsanSheraz](https://github.com/AhsanSheraz).
+
+### Internal
+
+* ๐ง Add sponsor Porter. PR [#10051](https://github.com/tiangolo/fastapi/pull/10051) by [@tiangolo](https://github.com/tiangolo).
+* ๐ง Update sponsors, add Jina back as bronze sponsor. PR [#10050](https://github.com/tiangolo/fastapi/pull/10050) by [@tiangolo](https://github.com/tiangolo).
* โฌ Bump mypy from 1.4.0 to 1.4.1. PR [#9756](https://github.com/tiangolo/fastapi/pull/9756) by [@dependabot[bot]](https://github.com/apps/dependabot).
* โฌ Bump mkdocs-material from 9.1.17 to 9.1.21. PR [#9960](https://github.com/tiangolo/fastapi/pull/9960) by [@dependabot[bot]](https://github.com/apps/dependabot).
diff --git a/docs/en/mkdocs.yml b/docs/en/mkdocs.yml
index a66b6c147..f75b84ff5 100644
--- a/docs/en/mkdocs.yml
+++ b/docs/en/mkdocs.yml
@@ -42,6 +42,16 @@ plugins:
search: null
markdownextradata:
data: ../en/data
+ redirects:
+ redirect_maps:
+ deployment/deta.md: deployment/cloud.md
+ advanced/sql-databases-peewee.md: how-to/sql-databases-peewee.md
+ advanced/async-sql-databases.md: how-to/async-sql-encode-databases.md
+ advanced/nosql-databases.md: how-to/nosql-databases-couchbase.md
+ advanced/graphql.md: how-to/graphql.md
+ advanced/custom-request-and-route.md: how-to/custom-request-and-route.md
+ advanced/conditional-openapi.md: how-to/conditional-openapi.md
+ advanced/extending-openapi.md: how-to/extending-openapi.md
nav:
- FastAPI: index.md
- Languages:
@@ -60,6 +70,7 @@ nav:
- ru: /ru/
- tr: /tr/
- uk: /uk/
+ - ur: /ur/
- vi: /vi/
- zh: /zh/
- features.md
@@ -130,24 +141,17 @@ nav:
- advanced/using-request-directly.md
- advanced/dataclasses.md
- advanced/middleware.md
- - advanced/sql-databases-peewee.md
- - advanced/async-sql-databases.md
- - advanced/nosql-databases.md
- advanced/sub-applications.md
- advanced/behind-a-proxy.md
- advanced/templates.md
- - advanced/graphql.md
- advanced/websockets.md
- advanced/events.md
- - advanced/custom-request-and-route.md
- advanced/testing-websockets.md
- advanced/testing-events.md
- advanced/testing-dependencies.md
- advanced/testing-database.md
- advanced/async-tests.md
- advanced/settings.md
- - advanced/conditional-openapi.md
- - advanced/extending-openapi.md
- advanced/openapi-callbacks.md
- advanced/openapi-webhooks.md
- advanced/wsgi.md
@@ -159,9 +163,21 @@ nav:
- deployment/https.md
- deployment/manually.md
- deployment/concepts.md
- - deployment/deta.md
+ - deployment/cloud.md
- deployment/server-workers.md
- deployment/docker.md
+- How To - Recipes:
+ - how-to/index.md
+ - how-to/general.md
+ - how-to/sql-databases-peewee.md
+ - how-to/async-sql-encode-databases.md
+ - how-to/nosql-databases-couchbase.md
+ - how-to/graphql.md
+ - how-to/custom-request-and-route.md
+ - how-to/conditional-openapi.md
+ - how-to/extending-openapi.md
+ - how-to/custom-docs-ui-assets.md
+ - how-to/configure-swagger-ui.md
- project-generation.md
- alternatives.md
- history-design-future.md
@@ -178,9 +194,9 @@ markdown_extensions:
guess_lang: false
mdx_include:
base_path: docs
- admonition:
- codehilite:
- extra:
+ admonition: null
+ codehilite: null
+ extra: null
pymdownx.superfences:
custom_fences:
- name: mermaid
@@ -188,8 +204,8 @@ markdown_extensions:
format: !!python/name:pymdownx.superfences.fence_code_format ''
pymdownx.tabbed:
alternate_style: true
- attr_list:
- md_in_html:
+ attr_list: null
+ md_in_html: null
extra:
analytics:
provider: google
@@ -240,6 +256,8 @@ extra:
name: tr - Tรผrkรงe
- link: /uk/
name: uk
+ - link: /ur/
+ name: ur
- link: /vi/
name: vi - Tiแบฟng Viแปt
- link: /zh/
diff --git a/docs/fr/docs/deployment/deta.md b/docs/fr/docs/deployment/deta.md
deleted file mode 100644
index cceb7b058..000000000
--- a/docs/fr/docs/deployment/deta.md
+++ /dev/null
@@ -1,245 +0,0 @@
-# Dรฉployer FastAPI sur Deta
-
-Dans cette section, vous apprendrez ร dรฉployer facilement une application **FastAPI** sur Deta en utilisant le plan tarifaire gratuit. ๐
-
-Cela vous prendra environ **10 minutes**.
-
-!!! info
- Deta sponsorise **FastAPI**. ๐
-
-## Une application **FastAPI** de base
-
-* Crรฉez un rรฉpertoire pour votre application, par exemple `./fastapideta/` et dรฉplacez-vous dedans.
-
-### Le code FastAPI
-
-* Crรฉer un fichier `main.py` avecย :
-
-```Python
-from fastapi import FastAPI
-
-app = FastAPI()
-
-
-@app.get("/")
-def read_root():
- return {"Hello": "World"}
-
-
-@app.get("/items/{item_id}")
-def read_item(item_id: int):
- return {"item_id": item_id}
-```
-
-### Dรฉpendances
-
-Maintenant, dans le mรชme rรฉpertoire, crรฉez un fichier `requirements.txt` avecย :
-
-```text
-fastapi
-```
-
-!!! tip "Astuce"
- Il n'est pas nรฉcessaire d'installer Uvicorn pour dรฉployer sur Deta, bien qu'il soit probablement souhaitable de l'installer localement pour tester votre application.
-
-### Structure du rรฉpertoire
-
-Vous aurez maintenant un rรฉpertoire `./fastapideta/` avec deux fichiersย :
-
-```
-.
-โโโ main.py
-โโโ requirements.txt
-```
-
-## Crรฉer un compte gratuit sur Deta
-
-Crรฉez maintenant un compte gratuit
-sur Deta, vous avez juste besoin d'une adresse email et d'un mot de passe.
-
-Vous n'avez mรชme pas besoin d'une carte de crรฉdit.
-
-## Installer le CLI (Interface en Ligne de Commande)
-
-Une fois que vous avez votre compte, installez le CLI de Deta :
-
-=== "Linux, macOS"
-
-
-
- ```console
- $ curl -fsSL https://get.deta.dev/cli.sh | sh
- ```
-
-
-
-=== "Windows PowerShell"
-
-
-
- ```console
- $ iwr https://get.deta.dev/cli.ps1 -useb | iex
- ```
-
-
-
-Aprรจs l'avoir installรฉ, ouvrez un nouveau terminal afin que la nouvelle installation soit dรฉtectรฉe.
-
-Dans un nouveau terminal, confirmez qu'il a รฉtรฉ correctement installรฉ avecย :
-
-
-
-```console
-$ deta --help
-
-Deta command line interface for managing deta micros.
-Complete documentation available at https://docs.deta.sh
-
-Usage:
- deta [flags]
- deta [command]
-
-Available Commands:
- auth Change auth settings for a deta micro
-
-...
-```
-
-
-
-!!! tip "Astuce"
- Si vous rencontrez des problรจmes pour installer le CLI, consultez la documentation officielle de Deta (en anglais).
-
-## Connexion avec le CLI
-
-Maintenant, connectez-vous ร Deta depuis le CLI avecย :
-
-
-
-```console
-$ deta login
-
-Please, log in from the web page. Waiting..
-Logged in successfully.
-```
-
-
-
-Cela ouvrira un navigateur web et permettra une authentification automatique.
-
-## Dรฉployer avec Deta
-
-Ensuite, dรฉployez votre application avec le CLI de Detaย :
-
-
-
-```console
-$ deta new
-
-Successfully created a new micro
-
-// Notice the "endpoint" ๐
-
-{
- "name": "fastapideta",
- "runtime": "python3.7",
- "endpoint": "https://qltnci.deta.dev",
- "visor": "enabled",
- "http_auth": "enabled"
-}
-
-Adding dependencies...
-
-
----> 100%
-
-
-Successfully installed fastapi-0.61.1 pydantic-1.7.2 starlette-0.13.6
-```
-
-
-
-Vous verrez un message JSON similaire ร ย :
-
-```JSON hl_lines="4"
-{
- "name": "fastapideta",
- "runtime": "python3.7",
- "endpoint": "https://qltnci.deta.dev",
- "visor": "enabled",
- "http_auth": "enabled"
-}
-```
-
-!!! tip "Astuce"
- Votre dรฉploiement aura une URL `"endpoint"` diffรฉrente.
-
-## Vรฉrifiez
-
-Maintenant, dans votre navigateur ouvrez votre URL `endpoint`. Dans l'exemple ci-dessus, c'รฉtait
-`https://qltnci.deta.dev`, mais la vรดtre sera diffรฉrente.
-
-Vous verrez la rรฉponse JSON de votre application FastAPIย :
-
-```JSON
-{
- "Hello": "World"
-}
-```
-
-Et maintenant naviguez vers `/docs` dans votre API, dans l'exemple ci-dessus ce serait `https://qltnci.deta.dev/docs`.
-
-Vous verrez votre documentation comme suitย :
-
-
-
-## Activer l'accรจs public
-
-Par dรฉfaut, Deta va gรฉrer l'authentification en utilisant des cookies pour votre compte.
-
-Mais une fois que vous รชtes prรชt, vous pouvez le rendre public avecย :
-
-
-
-```console
-$ deta auth disable
-
-Successfully disabled http auth
-```
-
-
-
-Maintenant, vous pouvez partager cette URL avec n'importe qui et ils seront en mesure d'accรฉder ร votre API. ๐
-
-## HTTPS
-
-Fรฉlicitationsโฏ! Vous avez dรฉployรฉ votre application FastAPI sur Detaโฏ! ๐ ๐ฐ
-
-Remarquez รฉgalement que Deta gรจre correctement HTTPS pour vous, vous n'avez donc pas ร vous en occuper et pouvez รชtre sรปr que vos clients auront une connexion cryptรฉe sรฉcurisรฉe. โ
๐
-
-## Vรฉrifiez le Visor
-
-ร partir de l'interface graphique de votre documentation (dans une URL telle que `https://qltnci.deta.dev/docs`)
-envoyez une requรชte ร votre *opรฉration de chemin* `/items/{item_id}`.
-
-Par exemple avec l'ID `5`.
-
-Allez maintenant sur https://web.deta.sh.
-
-Vous verrez qu'il y a une section ร gauche appelรฉe "Micros" avec chacune de vos applications.
-
-Vous verrez un onglet avec "Details", et aussi un onglet "Visor", allez ร l'onglet "Visor".
-
-Vous pouvez y consulter les requรชtes rรฉcentes envoyรฉes ร votre application.
-
-Vous pouvez รฉgalement les modifier et les relancer.
-
-
-
-## En savoir plus
-
-ร un moment donnรฉ, vous voudrez probablement stocker certaines donnรฉes pour votre application d'une maniรจre qui
-persiste dans le temps. Pour cela, vous pouvez utiliser Deta Base, il dispose รฉgalement d'un gรฉnรฉreux **plan gratuit**.
-
-Vous pouvez รฉgalement en lire plus dans la documentation Deta.
diff --git a/docs/ja/docs/deployment/concepts.md b/docs/ja/docs/deployment/concepts.md
new file mode 100644
index 000000000..38cbca219
--- /dev/null
+++ b/docs/ja/docs/deployment/concepts.md
@@ -0,0 +1,323 @@
+# ใใใญใคใกใณใใฎใณใณใปใใ
+
+**FastAPI**ใ็จใใใขใใชใฑใผใทใงใณใใใใญใคใใใจใใใใใใฏใฉใฎใใใชใฟใคใใฎWeb APIใงใใฃใฆใใใใใใๆฐใซใชใใณใณใปใใใใใใคใใใใพใใ
+
+ใใใใๆดป็จใใใใจใงใขใใชใฑใผใทใงใณใ**ใใใญใคใใใใใฎๆ้ฉใชๆนๆณ**ใ่ฆใคใใใใจใใงใใพใใ
+
+้่ฆใชใณใณใปใใใฎใใใคใใ็ดนไปใใพใ:
+
+* ใปใญใฅใชใใฃ - HTTPS
+* ่ตทๅๆใฎๅฎ่ก
+* ๅ่ตทๅ
+* ใฌใใชใฑใผใทใงใณ๏ผๅฎ่กไธญใฎใใญใปในๆฐ๏ผ
+* ใกใขใชใผ
+* ้ๅงๅใฎไบๅใฎในใใใ
+
+ใใใใ**ใใใญใคใกใณใ**ใซใฉใฎใใใชๅฝฑ้ฟใไธใใใใ่ฆใฆใใใพใใใใ
+
+ๆ็ต็ใช็ฎ็ใฏใ**ๅฎๅ
จใชๆนๆณใง**APIใฏใฉใคใขใณใใซ**ใตใผใในใๆไพ**ใใ**ไธญๆญใๅ้ฟ**ใใใ ใใงใชใใ**่จ็ฎใชใฝใผใน**๏ผไพใใฐใชใขใผใใตใผใใผ/ไปฎๆณใใทใณ๏ผใๅฏ่ฝใช้ใๅน็็ใซไฝฟ็จใใใใจใงใใ๐
+
+ใใฎ็ซ ใงใฏๅ่ฟฐใใ**ใณใณใปใใ**ใซใคใใฆใใใใ่ชฌๆใใพใใ
+
+ใใฎ่ชฌๆใ้ใใฆใๆฎๆฎตใจใฏ้ๅธธใซ็ฐใชใ็ฐๅขใๅญๅจใใชใใงใใใ**ๅฐๆฅใฎ**็ฐๅขใซๅฏพใใใใใญใคใฎๆนๆณใๆฑบใใไธใงๅฟ
่ฆใช**็ดๆ**ใไธใใฆใใใใใจใ้กใฃใฆใใพใใ
+
+ใใใใฎใณใณใปใใใๆ่ญใใใใจใซใใใ**ใใชใ่ช่บซใฎAPI**ใใใใญใคใใใใใฎๆ้ฉใชๆนๆณใ**่ฉไพก**ใใ**่จญ่จ**ใใใใจใใงใใใใใซใชใใงใใใใ
+
+ๆฌกใฎ็ซ ใงใฏใFastAPIใขใใชใฑใผใทใงใณใใใใญใคใใใใใฎ**ๅ
ทไฝ็ใชใฌใทใ**ใ็ดนไปใใพใใ
+
+ใใใใไปใฏใใใใฎ้่ฆใช**ใณใณใปใใใซๅบใฅใใขใคใใข**ใ็ขบ่ชใใพใใใใใใใใฎใณใณใปใใใฏใไปใฎใฉใฎใฟใคใใฎWeb APIใซใๅฝใฆใฏใพใใพใใ๐ก
+
+## ใปใญใฅใชใใฃ - HTTPS
+
+
+[ๅใใฃใใฟใผใฎHTTPSใซใคใใฆ](./https.md){.internal-link target=_blank}ใงใฏใHTTPSใใฉใฎใใใซAPIใๆๅทๅใใใฎใใซใคใใฆๅญฆใณใพใใใ
+
+้ๅธธใใขใใชใฑใผใทใงใณใตใผใใซใจใฃใฆ**ๅค้จใฎ**ใณใณใใผใใณใใงใใ**TLS Termination Proxy**ใซใใฃใฆๆไพใใใใใจใไธ่ฌ็ใงใใใใฎใใญใญใทใฏ้ไฟกใฎๆๅทๅใๆ
ๅฝใใพใใ
+
+ใใใซใปใญใฅใขใช้ไฟกใซใใใฆใHTTPS่จผๆๆธใฎๅฎๆ็ใชๆดๆฐใ่กใใพใใใใใใฏTLS Termination Proxyใจๅใใณใณใใผใใณใใๆ
ๅฝใใใใจใใใใฐใๅฅใฎใณใณใใผใใณใใๆ
ๅฝใใใใจใใใใพใใ
+
+### HTTPS ็จใใผใซใฎไพ
+TLS Termination Proxyใจใใฆไฝฟ็จใงใใใใผใซใซใฏไปฅไธใฎใใใชใใฎใใใใพใ๏ผ
+
+* Traefik
+ * ่จผๆๆธใฎๆดๆฐใ่ชๅ็ใซๅฆ็ โจ
+* Caddy
+ * ่จผๆๆธใฎๆดๆฐใ่ชๅ็ใซๅฆ็ โจ
+* Nginx
+ * ่จผๆๆธๆดๆฐใฎใใใซCertbotใฎใใใชๅค้จใณใณใใผใใณใใไฝฟ็จ
+* HAProxy
+ * ่จผๆๆธๆดๆฐใฎใใใซCertbotใฎใใใชๅค้จใณใณใใผใใณใใไฝฟ็จ
+* Nginx ใฎใใใช Ingress Controller ใๆใค Kubernetes
+ * ่จผๆๆธใฎๆดๆฐใซ cert-manager ใฎใใใชๅค้จใณใณใใผใใณใใไฝฟ็จ
+* ใฏใฉใฆใใปใใญใใคใใผใใตใผใในใฎไธ้จใจใใฆๅ
้จ็ใซๅฆ็๏ผไธ่จใๅ็
ง๐๏ผ
+
+ใใ1ใคใฎ้ธๆ่ขใฏใHTTPSใฎใปใใใขใใใๅซใใ ใใๅคใใฎไฝๆฅญใ่กใ**ใฏใฉใฆใใปใตใผใใน**ใๅฉ็จใใใใจใงใใ ใใฎใตใผใในใซใฏๅถ้ใใใฃใใใๆ้ใ้ซใใชใฃใใใใๅฏ่ฝๆงใใใใพใใใใใใใฎๅ ดๅใTLS Termination Proxyใ่ชๅใงใปใใใขใใใใๅฟ
่ฆใฏใชใใงใใ
+
+ๆฌกใฎ็ซ ใงๅ
ทไฝไพใใใใคใ็ดนไปใใพใใ
+
+---
+
+ๆฌกใซ่ๆ
ฎใในใใณใณใปใใใฏใๅฎ้ใฎAPIใๅฎ่กใใใใญใฐใฉใ ๏ผไพ๏ผUvicorn๏ผใซ้ข้ฃใใใใฎใในใฆใงใใ
+
+## ใใญใฐใฉใ ใจ ใใญใปใน
+
+็งใใกใฏใ**ใใญใปใน**ใใจใใ่จ่ใซใคใใฆใใใใ่ฉฑใใฎใงใใใฎๆๅณใใ**ใใญใฐใฉใ **ใใจใใ่จ่ใจใฎ้ใใๆ็ขบใซใใฆใใใจไพฟๅฉใงใใ
+
+### ใใญใฐใฉใ ใจใฏไฝใ
+
+**ใใญใฐใฉใ **ใจใใ่จ่ใฏใไธ่ฌ็ใซใใใใใชใใฎใ่กจ็พใใใฎใซไฝฟใใใพใ๏ผ
+
+* ใใญใฐใฉใใๆธใ**ใณใผใ**ใ**Pythonใใกใคใซ**
+* OSใซใใฃใฆๅฎ่กใใใใจใใงใใใใกใคใซ๏ผไพ: `python`, `python.exe` or `uvicorn`๏ผ
+* OSไธใง**ๅฎ่ก**ใใฆใใ้ใCPUใไฝฟ็จใใใกใขใชไธใซไฝใใไฟๅญใใ็นๅฎใฎใใญใฐใฉใ ๏ผ**ใใญใปใน**ใจใๅผใฐใใ๏ผ
+
+### ใใญใปในใจใฏไฝใ
+
+**ใใญใปใน**ใจใใ่จ่ใฏ้ๅธธใใใๅ
ทไฝ็ใชๆๅณใงไฝฟใใใOSใงๅฎ่กใใใฆใใใใฎใ ใใๆใใพใ๏ผๅ
ใปใฉใฎๆๅพใฎ่ชฌๆใฎใใใซ๏ผ๏ผ
+
+* OSไธใง**ๅฎ่ก**ใใฆใใ็นๅฎใฎใใญใฐใฉใ
+ * ใใใฏใใกใคใซใใณใผใใๆใใฎใงใฏใชใใOSใซใใฃใฆ**ๅฎ่ก**ใใใ็ฎก็ใใใฆใใใใฎใๆใใพใใ
+* ใฉใใชใใญใฐใฉใ ใใณใผใใใใใใ**ๅฎ่กใใใฆใใใจใใซใ ใๆฉ่ฝ**ใใพใใใคใพใใ**ใใญใปในใจใใฆๅฎ่กใใใฆใใใจใใ ใ**ใงใใ
+* ใใญใปในใฏใใฆใผใถใผใซใใใใฏOSใซใใฃใฆใ **็ตไบ**๏ผใใใใฏ "kill"๏ผใใใใใจใใงใใพใใใใฎๆ็นใงใใใญใปในใฏๅฎ่ก/ๅฎ่กใใใใใจใๅๆญขใใใใไปฅ้ใฏ**ไฝใใงใใชใใชใใพใ**ใ
+* ใณใณใใฅใผใฟใงๅฎ่กใใใฆใใๅใขใใชใฑใผใทใงใณใฏใๅฎ่กไธญใฎใใญใฐใฉใ ใๅใฆใฃใณใใฆใชใฉใใใฎ่ๅพใซใใใคใใฎใใญใปในใๆใฃใฆใใพใใใใใฆ้ๅธธใใณใณใใฅใผใฟใ่ตทๅใใฆใใ้ใ**ๅคใใฎใใญใปในใ**ๅๆใซๅฎ่กใใใฆใใพใใ
+* **ๅใใใญใฐใฉใ **ใฎ**่คๆฐใฎใใญใปใน**ใๅๆใซๅฎ่กใใใฆใใใใจใใใใพใใ
+
+OSใฎใใฟในใฏใปใใใผใธใฃใผใใใใทในใใ ใปใขใใฟใผใ๏ผใพใใฏๅๆงใฎใใผใซ๏ผใ็ขบ่ชใใใฐใใใใใฎใใญใปในใฎๅคใใๅฎ่กใใใฆใใใฎ่ฆใใใจใใงใใใงใใใใ
+
+ไพใใฐใๅใใใฉใฆใถใใญใฐใฉใ ๏ผFirefoxใChromeใEdgeใชใฉ๏ผใๅฎ่กใใฆใใใใญใปในใ่คๆฐใใใใจใใใใใพใใ้ๅธธใ1ใคใฎใฟใใซใคใ1ใคใฎใใญใปในใๅฎ่กใใใใใใซไปใฎใใญใปในใๅฎ่กใใใพใใ
+
+
+
+---
+
+ใใฆใ**ใใญใปใน**ใจ**ใใญใฐใฉใ **ใจใใ็จ่ชใฎ้ใใ็ขบ่ชใใใจใใใงใใใใญใคใกใณใใซใคใใฆ่ฉฑใ็ถใใพใใ
+
+## ่ตทๅๆใฎๅฎ่ก
+
+ใปใจใใฉใฎๅ ดๅใWeb APIใไฝๆใใใจใใฏใใฏใฉใคใขใณใใใใคใงใใขใฏใปในใงใใใใใซใ**ๅธธใซ**ไธญๆญใใใใใจใชใ**ๅฎ่กใใใ**ใใจใๆใฟใพใใใใกใใใ็นๅฎใฎ็ถๆณใงใฎใฟๅฎ่กใใใใ็นๅฅใช็็ฑใใใๅ ดๅใฏๅฅใงใใใใใฎๆ้ใฎใปใจใใฉใฏใๅธธใซๅฎ่กใใใ**ๅฉ็จๅฏ่ฝ**ใงใใใใจใๆใฟใพใใ
+
+### ใชใขใผใใตใผใใผไธใงใฎๅฎ่ก
+
+ใชใขใผใใตใผใใผ๏ผใฏใฉใฆใใตใผใใผใไปฎๆณใใทใณใชใฉ๏ผใใปใใใขใใใใใจใใซใงใใๆใ็ฐกๅใชใใจใฏใใญใผใซใซใง้็บใใใจใใจๅใใใใซใUvicorn๏ผใพใใฏๅๆงใฎใใฎ๏ผใๆๅใงๅฎ่กใใใใจใงใใ ใใฎๆนๆณใฏ**้็บไธญ**ใซใฏๅฝนใซ็ซใคใจๆใใใพใใ
+
+ใใใใใตใผใใผใธใฎๆฅ็ถใๅใใๅ ดๅใ**ๅฎ่กไธญใฎใใญใปใน**ใฏใใใใใใฆใณใใฆใใพใใงใใใใ
+
+ใใใฆใตใผใใผใๅ่ตทๅใใใๅ ดๅ๏ผใขใใใใผใใใฏใฉใฆใใใญใใคใใผใใใฎใใคใฐใฌใผใทใงใณใฎๅพใชใฉ๏ผใใใใใใใชใใฏใใใซ**ๆฐใฅใใชใใงใใใ**ใใใฎใใใใใญใปในใๆๅใงๅ่ตทๅใใชใใใฐใชใใชใใใจใใๆฐใฅใใชใใงใใใใใคใพใใAPIใฏใใฆใณใใใพใพใชใฎใงใใ๐ฑ
+
+### ่ตทๅๆใซ่ชๅ็ใซๅฎ่ก
+
+ไธ่ฌ็ใซใใตใผใใผใใญใฐใฉใ ๏ผUvicornใชใฉ๏ผใฏใตใผใใผ่ตทๅๆใซ่ชๅ็ใซ้ๅงใใใ**ไบบใฎไปๅ
ฅ**ใๅฟ
่ฆใจใใใซใAPIใจไธ็ทใซใใญใปในใๅธธใซๅฎ่กใใใใใใซใใใใจๆใใใพใ๏ผUvicornใFastAPIใขใใชใๅฎ่กใใใชใฉ๏ผใ
+
+### ๅฅใฎใใญใฐใฉใ ใฎ็จๆ
+
+ใใใๅฎ็พใใใใใซใ้ๅธธใฏ**ๅฅใฎใใญใฐใฉใ **ใ็จๆใใ่ตทๅๆใซใขใใชใฑใผใทใงใณใๅฎ่กใใใใใใซใใพใใใใใฆๅคใใฎๅ ดๅใไปใฎใณใณใใผใใณใใใขใใชใฑใผใทใงใณใไพใใฐใใผใฟใใผในใๅฎ่กใใใใใใซใใพใใ
+
+### ่ตทๅๆใซๅฎ่กใใใใผใซใฎไพ
+
+ๅฎ่กใใใใผใซใฎไพใใใใคใๆใใพใ:
+
+* Docker
+* Kubernetes
+* Docker Compose
+* Swarm ใขใผใใซใใ Docker
+* Systemd
+* Supervisor
+* ใฏใฉใฆใใใญใใคใใผใใตใผใในใฎไธ้จใจใใฆๅ
้จ็ใซๅฆ็
+* ใใฎใปใ...
+
+ๆฌกใฎ็ซ ใงใใใๅ
ทไฝ็ใชไพใๆใใฆใใใพใใ
+
+## ๅ่ตทๅ
+
+่ตทๅๆใซใขใใชใฑใผใทใงใณใๅฎ่กใใใใใจใ็ขบ่ชใใใฎใจๅๆงใซใๅคฑๆๅพใซใขใใชใฑใผใทใงใณใ**ๅ่ตทๅ**ใใใใใจใ็ขบ่ชใใใใจๆใใใพใใ
+
+### ๆใ
ใฏ้้ใใ็ฏใ
+
+็งใใกไบบ้ใฏๅธธใซ**้้ใ**ใ็ฏใใพใใใฝใใใฆใงใขใซใฏใใปใจใใฉๅธธใซ**ใใฐ**ใใใใใ็ฎๆใซ้ ใใใฆใใพใใ๐
+
+### ๅฐใใชใจใฉใผใฏ่ชๅ็ใซๅฆ็ใใใ
+
+FastAPIใงWeb APIใๆง็ฏใใ้ใซใใณใผใใซใจใฉใผใใใๅ ดๅใFastAPIใฏ้ๅธธใใจใฉใผใๅผใ่ตทใใใๅไธใฎใชใฏใจในใใซใจใฉใผใๅซใใพใใ๐ก
+
+ใฏใฉใคใขใณใใฏใใฎใชใฏใจในใใซๅฏพใใฆ**500 Internal Server Error**ใๅใๅใใพใใใใขใใชใฑใผใทใงใณใฏๅฎๅ
จใซใฏใฉใใทใฅใใใฎใงใฏใชใใๆฌกใฎใชใฏใจในใใฎใใใซๅไฝใ็ถใใพใใ
+
+### ้ๅคงใชใจใฉใผ - ใฏใฉใใทใฅ
+
+ใใใใชใใใ**ใขใใชใฑใผใทใงใณๅ
จไฝใใฏใฉใใทใฅใใใใใใชใณใผใใๆธใใฆ**UvicornใจPythonใใฏใฉใใทใฅใใใใใใชใฑใผในใใใใใใใใพใใใ๐ฅ
+
+ใใใงใใใใ็ฎๆใงใจใฉใผใ็บ็ใใใใใจใใฃใฆใใขใใชใฑใผใทใงใณใๅๆญขใใใใพใพใซใใใใชใใงใใใใ ๅฐใชใใจใๅฃใใฆใใชใ*ใในใชใใฌใผใทใงใณ*ใซใคใใฆใฏใ**ๅฎ่กใ็ถใใใ**ใฏใใงใใ
+
+### ใฏใฉใใทใฅๅพใฎๅ่ตทๅ
+
+ใใใใๅฎ่กไธญใฎ**ใใญใปใน**ใใฏใฉใใทใฅใใใใใใชๆฌๅฝใซใฒใฉใใจใฉใผใฎๅ ดๅใๅฐใชใใจใ2ใ3ๅใปใฉใใญใปในใ**ๅ่ตทๅ**ใใใๅค้จใณใณใใผใใณใใๅฟ
่ฆใงใใใใ
+
+!!! tip
+ ...ใจใฏใใใใขใใชใฑใผใทใงใณๅ
จไฝใ**ใใใซใฏใฉใใทใฅใใ**ใฎใงใใใฐใใใคใพใงใๅ่ตทๅใ็ถใใใฎใฏๆๅณใใชใใงใใใใใใใใใใฎๅ ดๅใฏใใใใ้็บไธญใๅฐใชใใจใใใใญใค็ดๅพใซๆฐใฅใใจๆใใใพใใ
+
+ ใใใงใ**ๅฐๆฅ**ใฏใฉใใทใฅใใๅฏ่ฝๆงใใใใใใใงใๅในใฟใผใใใใใใจใซๆๅณใใใใใใชใไธปใชใฑใผในใซ็ฆ็นใๅฝใฆใฆใฟใพใใ
+
+ใใชใใฏใใใใ**ๅค้จใณใณใใผใใณใ**ใใขใใชใฑใผใทใงใณใฎๅ่ตทๅใๆ
ๅฝใใใใจใๆใใจ่ใใพใใ ใชใใชใใใใฎๆ็นใงUvicornใจPythonใไฝฟใฃใๅใใขใใชใฑใผใทใงใณใฏใใงใซใฏใฉใใทใฅใใฆใใใๅใใขใใชใฑใผใทใงใณใฎๅใใณใผใใซๅฏพใใฆไฝใใงใใชใใใใงใใ
+
+### ่ชๅ็ใซๅ่ตทๅใใใใผใซใฎไพ
+
+ใปใจใใฉใฎๅ ดๅใๅ่ฟฐใใ**่ตทๅๆใซใใญใฐใฉใ ใๅฎ่กใใ**ใใใซไฝฟ็จใใใใใผใซใฏใ่ชๅใง**ๅ่ตทๅ**ใใใใจใซใๅฉ็จใใใพใใ
+
+ไพใใฐใๆฌกใฎใใใชใใฎใใใใพใ๏ผ
+
+* Docker
+* Kubernetes
+* Docker Compose
+* Swarm ใขใผใใซใใ Docker
+* Systemd
+* Supervisor
+* ใฏใฉใฆใใใญใใคใใผใใตใผใในใฎไธ้จใจใใฆๅ
้จ็ใซๅฆ็
+* ใใฎใปใ...
+
+## ใฌใใชใฑใผใทใงใณ - ใใญใปในใจใกใขใชใผ
+
+FastAPI ใขใใชใฑใผใทใงใณใงใฏใUvicorn ใฎใใใชใตใผใใผใใญใฐใฉใ ใไฝฟ็จใใ**1ใคใฎใใญใปใน**ใง1ๅบฆใซ่คๆฐใฎใฏใฉใคใขใณใใซๅๆใซๅฏพๅฟใงใใพใใ
+
+ใใใใๅคใใฎๅ ดๅใ่คๆฐใฎใฏใผใซใผใปใใญใปในใๅๆใซๅฎ่กใใใใจ่ใใใงใใใใ
+
+### ่คๆฐใฎใใญใปใน - Worker
+
+ใฏใฉใคใขใณใใฎๆฐใๅไธใฎใใญใปในใงๅฆ็ใงใใๆฐใ่ถ
ใใฆใใ๏ผใใจใใฐไปฎๆณใใทใณใใใใปใฉๅคงใใใชใๅ ดๅ๏ผใใใคใตใผใใผใฎ CPU ใซ**่คๆฐใฎใณใข**ใใใๅ ดๅใๅใใขใใชใฑใผใทใงใณใงๅๆใซ**่คๆฐใฎใใญใปใน**ใๅฎ่กใใใใในใฆใฎใชใฏใจในใใๅๆฃใใใใใจใใงใใพใใ
+
+ๅใAPIใใญใฐใฉใ ใฎ**่คๆฐใฎใใญใปใน**ใๅฎ่กใใๅ ดๅใใใใใฏไธ่ฌ็ใซ**Worker๏ผใฏใผใซใผ**ใจๅผใฐใใพใใ
+
+### ใฏใผใซใผใปใใญใปใน ใจ ใใผใ
+
+
+[HTTPSใซใคใใฆ](./https.md){.internal-link target=_blank}ใฎใใญใฅใกใณใใงใ1ใคใฎใตใผใใผใง1ใคใฎใใผใใจIPใขใใฌในใฎ็ตใฟๅใใใงใชใในใณใงใใใฎใฏ1ใคใฎใใญใปในใ ใใงใใใใจใ่ฆใใฆใใพใใงใใใใ๏ผ
+
+ใใใฏใใพใ ใซๅใใงใใ
+
+ใใฎใใใ**่คๆฐใฎใใญใปใน**ใๅๆใซๆใคใซใฏ**ใใผใใงใชใในใณใใฆใใๅไธใฎใใญใปใน**ใๅฟ
่ฆใงใใใใใใไฝใใใฎๆนๆณใงๅใฏใผใซใผใปใใญใปในใซ้ไฟกใ้ไฟกใใใใจใๆฑใใใใพใใ
+
+### ใใญใปในใใใใฎใกใขใชใผ
+
+ใใฆใใใญใฐใฉใ ใใกใขใชใซใญใผใใใ้ใซใฏใไพใใฐๆฉๆขฐๅญฆ็ฟใขใใซใๅคงใใชใใกใคใซใฎๅ
ๅฎนใๅคๆฐใซๅ
ฅใใใใใๅ ดๅใงใฏใ**ใตใผใใผใฎใกใขใช๏ผRAM๏ผ**ใๅฐใๆถ่ฒปใใพใใ
+
+ใใใฆ่คๆฐใฎใใญใปในใฏ้ๅธธใ**ใกใขใชใๅ
ฑๆใใพใใ**ใใใใฏใๅฎ่กไธญใฎๅใใญใปในใใใใใ็ฌ่ชใฎๅคๆฐใใกใขใช็ญใๆใฃใฆใใใใจใๆๅณใใพใใใคใพใใใณใผใๅ
ใงๅคง้ใฎใกใขใชใๆถ่ฒปใใฆใใๅ ดๅใ**ๅใใญใปใน**ใฏๅ็ญใฎ้ใฎใกใขใชใๆถ่ฒปใใใใจใซใชใใพใใ
+
+### ใตใผใใผใกใขใชใผ
+
+ไพใใฐใใใชใใฎใณใผใใ **1GBใฎใตใคใบใฎๆฉๆขฐๅญฆ็ฟใขใใซ**ใใญใผใใใๅ ดๅใAPIใง1ใคใฎใใญใปในใๅฎ่กใใใจใๅฐใชใใจใ1GBใฎRAMใๆถ่ฒปใใพใใ
+
+ใพใใ**4ใคใฎใใญใปใน**๏ผ4ใคใฎใฏใผใซใผ๏ผใ่ตทๅใใใจใใใใใใ1GBใฎRAMใๆถ่ฒปใใพใใใคใพใใๅ่จใงAPIใฏ**4GBใฎRAM**ใๆถ่ฒปใใใใจใซใชใใพใใ
+
+ใชใขใผใใตใผใใผใไปฎๆณใใทใณใฎRAMใ3GBใใใชใๅ ดๅใ4GBไปฅไธใฎRAMใใญใผใใใใใจใใใจๅ้กใ็บ็ใใพใใ๐จ
+
+### ่คๆฐใใญใปใน - ไพ
+
+ใใฎไพใงใฏใ2ใคใฎ**ใฏใผใซใผใปใใญใปใน**ใ่ตทๅใๅถๅพกใใ**ใใใผใธใฃใผใป ใใญใปใน**ใใใใพใใ
+
+ใใฎใใใผใธใฃใผใป ใใญใปในใฏใใใใใIPใฎ**ใใผใ**ใงใชใในใณใใฆใใใใฎใงใใใใใฆใใในใฆใฎ้ไฟกใใฏใผใซใผใปใใญใปในใซ่ปข้ใใพใใ
+
+ใใใใฎใฏใผใซใผใปใใญใปในใฏใใขใใชใฑใผใทใงใณใๅฎ่กใใใใฎใงใใใ**ใชใฏใจในใ**ใๅใใฆ**ใฌในใใณใน**ใ่ฟใใใใฎไธป่ฆใช่จ็ฎใ่กใใใใชใใๅคๆฐใซๅ
ฅใใใใฎใฏไฝใงใRAMใซใญใผใใใพใใ
+
+
+
+ใใใฆใใกใใใๅใใใทใณใงใฏใใใชใใฎใขใใชใฑใผใทใงใณใจใฏๅฅใซใ**ไปใฎใใญใปใน**ใๅฎ่กใใใฆใใใงใใใใ
+
+่ๅณๆทฑใใใจใซใๅใใญใปในใไฝฟ็จใใ**CPU**ใฎๅฒๅใฏๆ้ใจใจใใซๅคงใใ**ๅคๅ**ใใๅฏ่ฝๆงใใใใพใใใ**ใกใขใช๏ผRAM๏ผ**ใฏ้ๅธธใๅคใใๅฐใชใใ**ๅฎๅฎ**ใใพใใ
+
+ๆฏๅๅ็จๅบฆใฎ่จ็ฎใ่กใAPIใใใใๅคใใฎใฏใฉใคใขใณใใใใใฎใงใใใฐใ**CPUไฝฟ็จ็**ใใใใใ**ๅฎๅฎ**ใใใงใใใ๏ผๅธธใซๆฅๆฟใซไธไธใใใฎใงใฏใชใ๏ผใ
+
+### ใฌใใชใฑใผใทใงใณใปใใผใซใจๆฆ็ฅใฎไพ
+
+ใใใๅฎ็พใใใซใฏใใใคใใฎใขใใญใผใใใใใพใใใๅ
ทไฝ็ใชๆฆ็ฅใซใคใใฆใฏๆฌกใฎ็ซ (Dockerใใณใณใใใฎ็ซ ใชใฉ)ใง่ฉณใใ่ชฌๆใใพใใ
+
+่ๆ
ฎใในใไธปใชๅถ็ดใฏใ**ใใใชใใฏIP**ใฎ**ใใผใ**ใๅฆ็ใใ**ๅไธใฎ**ใณใณใใผใใณใใๅญๅจใใชใใใฐใชใใชใใจใใใใจใงใใ
+
+ใใใฆใใฌใใชใฑใผใใใใ**ใใญใปใน/ใฏใผใซใผ**ใซ้ไฟกใ**้ไฟก**ใใๆนๆณใๆใคๅฟ
่ฆใใใใพใใ
+
+่ใใใใ็ตใฟๅใใใจๆฆ็ฅใใใใคใ็ดนไปใใพใ๏ผ
+
+* **Gunicorn**ใ**Uvicornใฏใผใซใผ**ใ็ฎก็
+ * Gunicornใฏ**IP**ใจ**ใใผใ**ใใชใในใณใใ**ใใญใปในใใใผใธใฃ**ใงใใฌใใชใฑใผใทใงใณใฏ**่คๆฐใฎUvicornใฏใผใซใผใปใใญใปใน**ใๆใคใใจใซใใฃใฆ่กใใใใ
+* **Uvicorn**ใ**Uvicornใฏใผใซใผ**ใ็ฎก็
+ * 1ใคใฎUvicornใฎ**ใใญใปในใใใผใธใฃใผ**ใ**IP**ใจ**ใใผใ**ใใชใในใณใใ**่คๆฐใฎUvicornใฏใผใซใผใปใใญใปใน**ใ่ตทๅใใใ
+* **Kubernetes**ใใใฎไปใฎๅๆฃ**ใณใณใใใปใทในใใ **
+ * **Kubernetes**ใฌใคใคใผใฎไฝใใ**IP**ใจ**ใใผใ**ใใชใในใณใใใใฌใใชใฑใผใทใงใณใฏใ**่คๆฐใฎใณใณใใ**ใซใใใใ**1ใคใฎUvicornใใญใปใน**ใๅฎ่กใใใใใจใง่กใใใใ
+* **ใฏใฉใฆใใปใตใผใใน**ใซใใใฌใใชใฑใผใทใงใณ
+ * ใฏใฉใฆใใปใตใผใในใฏใใใใ**ใใชใใฎใใใซใฌใใชใฑใผใทใงใณใๅฆ็**ใใพใใ**ๅฎ่กใใใใญใปใน**ใไฝฟ็จใใ**ใณใณใใใคใกใผใธ**ใๅฎ็พฉใงใใใใใใใพใใใใใใใใซใใใใใใฏใใใใ**ๅไธใฎUvicornใใญใปใน**ใงใใใใฏใฉใฆใใตใผใในใฏใใฎใฌใใชใฑใผใทใงใณใๆ
ๅฝใใใงใใใใ
+
+!!! tip
+ ใใใใฎ**ใณใณใใ**ใDockerใใใฆKubernetesใซ้ขใใ้
็ฎใใใพใ ใใพใๆๅณใใชใใฆใใชใใฆใๅฟ้
ใใชใใงใใ ใใใ
+
+
+ ใณใณใใใปใคใกใผใธใDockerใKubernetesใชใฉใซใคใใฆใฏใๆฌกใฎ็ซ ใง่ฉณใใ่ชฌๆใใพใ: [ใณใณใใๅ
ใฎFastAPI - Docker](./docker.md){.internal-link target=_blank}.
+
+## ้ๅงๅใฎไบๅใฎในใใใ
+
+ใขใใชใฑใผใทใงใณใ**้ๅงใใๅ**ใซใใใใคใใฎในใใใใๅฎ่กใใใๅ ดๅใๅคใใใใพใใ
+
+ไพใใฐใ**ใใผใฟใใผในใปใใคใฐใฌใผใทใงใณ** ใๅฎ่กใใใใใใใใพใใใ
+
+ใใใใปใจใใฉใฎๅ ดๅใใใใใฎๆ้ ใ**1ๅบฆ**ใซๅฎ่กใใใใจ่ใใใงใใใใ
+
+ใใฎใใใใขใใชใฑใผใทใงใณใ้ๅงใใๅใฎ**ไบๅใฎในใใใ**ใๅฎ่กใใ**ๅไธใฎใใญใปใน**ใ็จๆใใใใจๆใใใพใใ
+
+ใใใฆใใใใใฎไบๅใฎในใใใใๅฎ่กใใฆใใใฎใๅไธใฎใใญใปในใงใใใใจใ็ขบ่ชใใๅฟ
่ฆใใใใพใใใใฎใใจใฏใใฎๅพใขใใชใฑใผใทใงใณ่ชไฝใฎใใใซ**่คๆฐใฎใใญใปใน**๏ผ่คๆฐใฎใฏใผใซใผ๏ผใ่ตทๅใใๅ ดๅใๅๆงใงใใ
+
+ใใใใฎในใใใใ**่คๆฐใฎใใญใปใน**ใซใใฃใฆๅฎ่กใใใๅ ดๅใ**ไธฆๅ**ใซๅฎ่กใใใใใจใซใใฃใฆไฝๆฅญใ**้่ค**ใใใใจใซใชใใพใใใใใฆใใใใใฎในใใใใใใผใฟใใผในใฎใใคใฐใฌใผใทใงใณใฎใใใช็น็ดฐใชใใฎใงใใฃใๅ ดๅใไบใใซ็ซถๅใๅผใ่ตทใใๅฏ่ฝๆงใใใใพใใ
+
+ใใกใใใไบๅใฎในใใใใไฝๅบฆใๅฎ่กใใฆใๅ้กใใชใๅ ดๅใใใใใใฎ้ใฏๅฏพๅฆใใใชใๆฅฝใซใชใใพใใ
+
+!!! tip
+ ใพใใใปใใใขใใใซใใฃใฆใฏใใขใใชใฑใผใทใงใณใ้ๅงใใๅใฎ**ไบๅใฎในใใใ**ใๅฟ
่ฆใชใๅ ดๅใใใใใจใ่ฆใใฆใใใฆใใ ใใใ
+
+ ใใฎๅ ดๅใฏใใใฎใใใชใใจใๅฟ้
ใใๅฟ
่ฆใฏใชใใงใใ๐คท
+
+### ไบๅในใใใใฎๆฆ็ฅไพ
+
+ใใใฏ**ใทในใใ ใ**ใใใญใคใใๆนๆณใซ**ๅคงใใไพๅญ**ใใใ ใใใใใใใใใใญใฐใฉใ ใฎ่ตทๅๆนๆณใๅ่ตทๅใฎๅฆ็ใชใฉใซใ้ขไฟใใฆใใใงใใใใ
+
+่ใใใใใขใคใใขใใใใคใๆใใฆใฟใพใ๏ผ
+
+* ใขใใชใณใณใใใฎๅใซๅฎ่กใใใKubernetesใฎInitใณใณใใ
+* ไบๅใฎในใใใใๅฎ่กใใใขใใชใฑใผใทใงใณใ่ตทๅใใbashในใฏใชใใ
+ * ๅฉ็จใใbashในใฏใชใใใ่ตทๅ๏ผๅ่ตทๅใใใใใจใฉใผใๆคๅบใใใใใๆนๆณใฏไปฅๅใจใใฆๅฟ
่ฆใซใชใใงใใใใ
+
+!!! tip
+
+ ใณใณใใใไฝฟใฃใๅ
ทไฝ็ใชไพใซใคใใฆใฏใๆฌกใฎ็ซ ใง็ดนไปใใพใ: [ใณใณใใๅ
ใฎFastAPI - Docker](./docker.md){.internal-link target=_blank}.
+
+## ใชใฝใผในใฎๅฉ็จ
+
+ใใชใใฎใตใผใใผใฏ**ใชใฝใผใน**ใงใใใใใญใฐใฉใ ใๅฎ่กใCPUใฎ่จ็ฎๆ้ใๅฉ็จๅฏ่ฝใชRAMใกใขใชใๆถ่ฒปใพใใฏ**ๅฉ็จ**ใใใใจใใงใใพใใ
+
+ใทในใใ ใชใฝใผในใใฉใใใใๆถ่ฒป๏ผๅฉ็จใใใใงใใ๏ผ ใๅฐใชใๆนใ่ฏใใใจ่ใใใฎใฏ็ฐกๅใใใใใชใใงใใใๅฎ้ใซใฏใ**ใฏใฉใใทใฅใใใซๅฏ่ฝใช้ใ**ๆๅคง้ใซๆดป็จใใใใงใใใใ
+
+3ๅฐใฎใตใผใใผใซใ้ใๆใฃใฆใใใซใ้ขใใใใใใฎRAMใจCPUใๅฐใใใไฝฟใฃใฆใใชใใจใใใใใใใใ**ใ้ใ็ก้งใซใใฆใใ** ๐ธใใใใใ**ใตใผใใผใฎ้ปๅใ็ก้งใซใใฆใใ** ๐ใใจใซใชใใงใใใใ
+
+ใใฎๅ ดๅใฏใใตใผใใผใ2ๅฐใ ใใซใใฆใใใฎใชใฝใผใน๏ผCPUใใกใขใชใใใฃในใฏใใใใใฏใผใฏๅธฏๅๅน
ใชใฉ๏ผใใใ้ซใๅฒๅใงไฝฟ็จใใๆนใใใใงใใใใ
+
+ไธๆนใ2ๅฐใฎใตใผใใผใใใใใใฎCPUใจRAMใฎ**100%ใไฝฟ็จใใฆใใ**ๅ ดๅใใใๆ็นใง1ใคใฎใใญใปในใใใๅคใใฎใกใขใชใ่ฆๆฑใใใตใผใใผใฏใใฃในใฏใใใกใขใชใใจใใฆไฝฟ็จใใชใใจใใใพใใใ๏ผไฝๅๅใ้
ใใชใๅฏ่ฝๆงใใใใพใใ๏ผ
+ใใใใฏ**ใฏใฉใใทใฅ**ใใใใจใใใใฐใใใใใฏใใใใญใปในใไฝใใใฎ่จ็ฎใใใๅฟ
่ฆใใใใใใใฆCPUใๅใณ็ฉบใใพใงๅพ
ใใชใใใฐใชใใชใใใใใใพใใใ
+
+ใใฎๅ ดๅใ**1ใคไฝๅใชใตใผใใผ**ใ็จๆใใใใฎไธใงใใใคใใฎใใญใปในใๅฎ่กใใใในใฆใฎใตใผใใผใ**ๅๅใชRAMใจCPUๆ้ใๆใคใใใซใใ**ใฎใใใใงใใใใ
+
+ใพใใไฝใใใฎ็็ฑใงAPIใฎๅฉ็จใๆฅๅขใใๅฏ่ฝๆงใใใใพใใใใใใใใใใใๆต่กใฃใใฎใใใใใชใใใไปใฎใตใผใในใใใใใไฝฟใๅงใใใฎใใใใใชใใงใใใใฎใใใชๅ ดๅใซๅใใฆใไฝๅใชใชใฝใผในใ็จๆใใฆใใใจๅฎๅฟใงใใใใ
+
+ไพใใฐใใชใฝใผในไฝฟ็จ็ใฎ**50%ใใ90%ใฎ็ฏๅฒ**ใง**ไปปๆใฎๆฐๅญ**ใใฟใผใฒใใใจใใใใจใใงใใพใใ
+
+้่ฆใชใฎใฏใใใใญใคใกใณใใๅพฎ่ชฟๆดใใใใใซใฟใผใฒใใใ่จญๅฎใๆธฌๅฎใใใใจใใใใใใไฝฟ็จใใใไธป่ฆใช่ฆ็ด ใงใใใใจใงใใ
+
+`htop`ใฎใใใชๅ็ดใชใใผใซใไฝฟใฃใฆใใตใผใใผใงไฝฟ็จใใใฆใใCPUใRAMใใใใใฏๅใใญใปในใงไฝฟ็จใใใฆใใ้ใ่ฆใใใจใใงใใพใใใใใใฏใใใ่ค้ใช็ฃ่ฆใใผใซใไฝฟใฃใฆใใตใผใใซๅๆฃใใฆไฝฟ็จใใใใจใใงใใพใใ
+
+## ใพใจใ
+
+ใขใใชใฑใผใทใงใณใฎใใใญใคๆนๆณใๆฑบๅฎใใ้ใซใ่ๆ
ฎใในใใงใใใไธป่ฆใชใณใณใปใใใฎใใใคใใ็ดนไปใใฆใใใพใใ๏ผ
+
+* ใปใญใฅใชใใฃ - HTTPS
+* ่ตทๅๆใฎๅฎ่ก
+* ๅ่ตทๅ
+* ใฌใใชใฑใผใทใงใณ๏ผๅฎ่กไธญใฎใใญใปในๆฐ๏ผ
+* ใกใขใชใผ
+* ้ๅงๅใฎไบๅในใใใ
+
+ใใใใฎ่ใๆนใจใใฎ้ฉ็จๆนๆณใ็่งฃใใใใจใงใใใใญใคใกใณใใ่จญๅฎใใใ่ชฟๆดใใใใใ้ใซๅฟ
่ฆใช็ดๆ็ใชๅคๆญใใงใใใใใซใชใใฏใใงใใ๐ค
+
+ๆฌกใฎใปใฏใทใงใณใงใฏใใใชใใๅใๅพใๆฆ็ฅใซใคใใฆใใใๅ
ทไฝ็ใชไพใๆใใพใใ๐
diff --git a/docs/ja/docs/deployment/deta.md b/docs/ja/docs/deployment/deta.md
deleted file mode 100644
index 723f169a0..000000000
--- a/docs/ja/docs/deployment/deta.md
+++ /dev/null
@@ -1,240 +0,0 @@
-# Deta ใซใใใญใค
-
-ใใฎใปใฏใทใงใณใงใฏใ**FastAPI** ใขใใชใฑใผใทใงใณใ Deta ใฎ็กๆใใฉใณใๅฉ็จใใฆใ็ฐกๅใซใใใญใคใใๆนๆณใๅญฆ็ฟใใพใใ๐
-
-ๆ่ฆๆ้ใฏ็ด**10ๅ**ใงใใ
-
-!!! info "ๅ่"
- Deta ใฏ **FastAPI** ใฎในใใณใตใผใงใใ๐
-
-## ใใผใทใใฏใช **FastAPI** ใขใใช
-
-* ใขใใชใฎใใใฎใใฃใฌใฏใใช (ไพใใฐ `./fastapideta/`) ใไฝๆใใใใฎไธญใซๅ
ฅใฃใฆใใ ใใใ
-
-### FastAPI ใฎใณใผใ
-
-* ไปฅไธใฎ `main.py` ใใกใคใซใไฝๆใใฆใใ ใใ:
-
-```Python
-from fastapi import FastAPI
-
-app = FastAPI()
-
-
-@app.get("/")
-def read_root():
- return {"Hello": "World"}
-
-
-@app.get("/items/{item_id}")
-def read_item(item_id: int):
- return {"item_id": item_id}
-```
-
-### Requirements
-
-ใงใฏใๅใใใฃใฌใฏใใชใซไปฅไธใฎ `requirements.txt` ใใกใคใซใไฝๆใใฆใใ ใใ:
-
-```text
-fastapi
-```
-
-!!! tip "่ฑ็ฅ่ญ"
- ใขใใชใฎใญใผใซใซใในใใฎใใใซ Uvicorn ใใคใณในใใผใซใใใใชใใใใใใพใใใใDeta ใธใฎใใใญใคใซใฏไธ่ฆใงใใ
-
-### ใใฃใฌใฏใใชๆง้
-
-ไปฅไธใฎ2ใคใฎใใกใคใซใจ1ใคใฎ `./fastapideta/` ใใฃใฌใฏใใชใใใใฏใใงใ:
-
-```
-.
-โโโ main.py
-โโโ requirements.txt
-```
-
-## Detaใฎ็กๆใขใซใฆใณใใฎไฝๆ
-
-ใใใงใฏใDetaใฎ็กๆใขใซใฆใณใใไฝๆใใพใใใใๅฟ
่ฆใชใใฎใฏใกใผใซใขใใฌในใจใในใฏใผใใ ใใงใใ
-
-ใฏใฌใธใใใซใผใใใๅฟ
่ฆใใใพใใใ
-
-## CLIใฎใคใณในใใผใซ
-
-ใขใซใฆใณใใๅๅพใใใใDeta CLI ใใคใณในใใผใซใใฆใใ ใใ:
-
-=== "Linux, macOS"
-
-
-
- ```console
- $ curl -fsSL https://get.deta.dev/cli.sh | sh
- ```
-
-
-
-=== "Windows PowerShell"
-
-
-
- ```console
- $ iwr https://get.deta.dev/cli.ps1 -useb | iex
- ```
-
-
-
-ใคใณในใใผใซใใใใใคใณในใใผใซใใ CLI ใๆๅนใซใใใใใซๆฐใใชใฟใผใใใซใ้ใใฆใใ ใใใ
-
-ๆฐใใชใฟใผใใใซไธใงใๆญฃใใใคใณในใใผใซใใใใ็ขบ่ชใใพใ:
-
-
-
-```console
-$ deta --help
-
-Deta command line interface for managing deta micros.
-Complete documentation available at https://docs.deta.sh
-
-Usage:
- deta [flags]
- deta [command]
-
-Available Commands:
- auth Change auth settings for a deta micro
-
-...
-```
-
-
-
-!!! tip "่ฑ็ฅ่ญ"
- CLI ใฎใคใณในใใผใซใซๅ้กใ็บ็ใใๅ ดๅใฏใDeta ๅ
ฌๅผใใญใฅใกใณใใๅ็
งใใฆใใ ใใใ
-
-## CLIใงใญใฐใคใณ
-
-CLI ใใ Deta ใซใญใฐใคใณใใฆใฟใพใใใ:
-
-
-
-```console
-$ deta login
-
-Please, log in from the web page. Waiting..
-Logged in successfully.
-```
-
-
-
-่ชๅ็ใซใฆใงใใใฉใฆใถใ้ใใฆใ่ช่จผๅฆ็ใ่กใใใพใใ
-
-## Deta ใงใใใญใค
-
-ๆฌกใซใใขใใชใฑใผใทใงใณใ Deta CLIใงใใใญใคใใพใใใ:
-
-
-
-```console
-$ deta new
-
-Successfully created a new micro
-
-// Notice the "endpoint" ๐
-
-{
- "name": "fastapideta",
- "runtime": "python3.7",
- "endpoint": "https://qltnci.deta.dev",
- "visor": "enabled",
- "http_auth": "enabled"
-}
-
-Adding dependencies...
-
-
----> 100%
-
-
-Successfully installed fastapi-0.61.1 pydantic-1.7.2 starlette-0.13.6
-```
-
-
-
-ๆฌกใฎใใใชJSONใกใใปใผใธใ่กจ็คบใใใพใ:
-
-```JSON hl_lines="4"
-{
- "name": "fastapideta",
- "runtime": "python3.7",
- "endpoint": "https://qltnci.deta.dev",
- "visor": "enabled",
- "http_auth": "enabled"
-}
-```
-
-!!! tip "่ฑ็ฅ่ญ"
- ใใชใใฎใใใญใคใงใฏ็ฐใชใ `"endpoint"` URLใ่กจ็คบใใใใงใใใใ
-
-## ็ขบ่ช
-
-ใใใงใฏใ`endpoint` URLใใใฉใฆใถใง้ใใฆใฟใพใใใใไธ่จใฎไพใงใฏ `https://qltnci.deta.dev` ใงใใใใใชใใฎURLใฏ็ฐใชใใฏใใงใใ
-
-FastAPIใขใใชใใ่ฟใฃใฆใใJSONใฌในใใณในใ่กจ็คบใใใพใ:
-
-```JSON
-{
- "Hello": "World"
-}
-```
-
-ใใใฆ `/docs` ใธ็งปๅใใฆใใ ใใใไธ่จใฎไพใงใฏใ`https://qltnci.deta.dev/docs` ใงใใ
-
-ๆฌกใฎใใใชใใญใฅใกใณใใ่กจ็คบใใใพใ:
-
-
-
-## ใใใชใใฏใขใฏใปในใฎๆๅนๅ
-
-ใใใฉใซใใงใฏใDeta ใฏใฏใใญใผใ็จใใฆใขใซใฆใณใใฎ่ช่จผใ่กใใพใใ
-
-ใใใใๆบๅใๆดใใฐใไปฅไธใฎๆงใซๅ
ฌ้ใงใใพใ:
-
-
-
-```console
-$ deta auth disable
-
-Successfully disabled http auth
-```
-
-
-
-ใใใงใURLใๅ
ฑๆใใใจAPIใซใขใฏใปในใงใใใใใซใชใใพใใ๐
-
-## HTTPS
-
-ใใใงใจใใใใใพใ๏ผใใชใใฎ FastAPI ใขใใชใ Deta ใธใใใญใคใใใพใใ๏ผ๐ ๐ฐ
-
-ใพใใDetaใHTTPSใๆญฃใใๅฆ็ใใใใใใใฎๅฆ็ใ่กใๅฟ
่ฆใใชใใใฏใฉใคใขใณใใฏๆๅทๅใใใๅฎๅ
จใช้ไฟกใๅฉ็จใงใใพใใโ
๐
-
-## Visor ใ็ขบ่ช
-
-ใใญใฅใกใณใUI (`https://qltnci.deta.dev/docs` ใฎใใใชURLใซใใ) ใฏ *path operation* `/items/{item_id}` ใธใชใฏใจในใใ้ใใใจใใงใใพใใ
-
-ID `5` ใฎไพใ็คบใใพใใ
-
-ใพใใhttps://web.deta.sh ใธใขใฏใปในใใพใใ
-
-ๅทฆๅดใซๅใขใใชใฎ ใMicrosใ ใจใใใปใฏใทใงใณใ่กจ็คบใใใพใใ
-
-ใพใใใDetailsใใใVisorใใฟใใ่กจ็คบใใใฆใใพใใใVisorใใฟใใธ็งปๅใใฆใใ ใใใ
-
-ใใใงใขใใชใซ้ใใใ็ด่ฟใฎใชใฏใจในใใ่ชฟในใใใพใใ
-
-ใพใใใใใใ็ทจ้ใใฆใชใใฌใคใงใใพใใ
-
-
-
-## ใใใซ่ฉณใใ็ฅใ
-
-ๆงใ
ใช็ฎๆใงๆฐธ็ถ็ใซใใผใฟใไฟๅญใใใใชใใงใใใใใใฎใใใซใฏ Deta Base ใไฝฟ็จใงใใพใใๆใใฟใชใ **็กๆๅฉ็จๆ ** ใใใใพใใ
-
-่ฉณใใใฏ Deta ใใญใฅใกใณใใๅ็
งใใฆใใ ใใใ
diff --git a/docs/ja/docs/deployment/docker.md b/docs/ja/docs/deployment/docker.md
index f10312b51..ca9dedc3c 100644
--- a/docs/ja/docs/deployment/docker.md
+++ b/docs/ja/docs/deployment/docker.md
@@ -1,71 +1,157 @@
-# Dockerใไฝฟ็จใใใใใญใค
+# ใณใณใใๅ
ใฎFastAPI - Docker
-ใใฎใปใฏใทใงใณใงใฏไปฅไธใฎไฝฟใๆนใฎ็ดนไปใจใฌใคใใธใฎใชใณใฏใ็ขบ่ชใงใใพใ:
+FastAPIใขใใชใฑใผใทใงใณใใใใญใคใใๅ ดๅใไธ่ฌ็ใชใขใใญใผใใฏ**Linuxใณใณใใใปใคใกใผใธ**ใใใซใใใใใจใงใใ
-* **5ๅ**็จๅบฆใงใ**FastAPI** ใฎใขใใชใฑใผใทใงใณใใใใใฉใผใใณในใๆๅคง้ใซ็บๆฎใใDockerใคใกใผใธ (ใณใณใใ)ใซใใใ
-* (ใชใใทใงใณ) ้็บ่
ใจใใฆๅฟ
่ฆใช็ฏๅฒใงHTTPSใ็่งฃใใใ
-* **20ๅ**็จๅบฆใงใ่ชๅ็ใชHTTPS็ๆใจใจใใซDockerใฎSwarmใขใผใ ใฏใฉในใฟใใปใใใขใใใใ (ๆ5ใใซใฎใทใณใใซใชใตใผใใผไธใง)ใ
-* **10ๅ**็จๅบฆใงใDockerใฎSwarmใขใผใ ใฏใฉในใฟใไฝฟใฃใฆใHTTPSใชใฉใไฝฟ็จใใๅฎๅ
จใช**FastAPI** ใขใใชใฑใผใทใงใณใฎไฝๆใจใใใญใคใ
+ๅบๆฌ็ใซใฏ **Docker**ใ็จใใฆ่กใใใพใใ็ๆใใใใณใณใใใปใคใกใผใธใฏใใใใคใใฎๆนๆณใฎใใใใใงใใใญใคใงใใพใใ
-ใใใญใคใฎใใใซใ**Docker** ใๅฉ็จใงใใพใใใปใญใฅใชใใฃใๅ็พๆงใ้็บใฎใทใณใใซใใชใฉใซๅฉ็นใใใใพใใ
+Linuxใณใณใใใฎไฝฟ็จใซใฏใ**ใปใญใฅใชใใฃ**ใ**ๅๅพฉๅฏ่ฝๆง๏ผใฌใใชใซใใชใใฃ๏ผ**ใ**ใทใณใใชใทใใฃ**ใชใฉใใใใคใใฎๅฉ็นใใใใพใใ
-Dockerใไฝฟใๅ ดๅใๅ
ฌๅผใฎDockerใคใกใผใธใๅฉ็จใงใใพใ:
+!!! tip
+ TODO: ใชใใ้ท็งปใงใใชใ
+ ใๆฅใใงใใใงใซใใใใฎๆ
ๅ ฑใใๅญใใงใใ๏ผ [ไปฅไธใฎ`Dockerfile`ใฎ็ฎๆ๐](#build-a-docker-image-for-fastapi)ใธใธใฃใณใใใฆใใ ใใใ
-## tiangolo/uvicorn-gunicorn-fastapi
+
+Dockerfile ใใฌใใฅใผ ๐
-ใใฎใคใกใผใธใฏใ่ชๅใใฅใผใใณใฐใๆฉๆงใๅซใใงใใพใใ็ ็ฒใๆใใใจใชใใใใ ใณใผใใๅ ใใใ ใใง่ชๅ็ใซ้ซใใใฉใผใใณในใๅฎ็พใงใใพใใ
+```Dockerfile
+FROM python:3.9
-ใใ ใใ็ฐๅขๅคๆฐใ่จญๅฎใใกใคใซใไฝฟใฃใฆๅ
จใฆใฎ่จญๅฎใฎๅคๆดใๆดๆฐใ่กใใพใใ
+WORKDIR /code
-!!! tip "่ฑ็ฅ่ญ"
- ๅ
จใฆใฎ่จญๅฎใจใชใใทใงใณใ็ขบ่ชใใใซใฏใDockerใคใกใผใธใใผใธใ้ใใฆไธใใ: tiangolo/uvicorn-gunicorn-fastapi.
+COPY ./requirements.txt /code/requirements.txt
-## `Dockerfile` ใฎไฝๆ
+RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
-* ใใญใธใงใฏใใใฃใฌใฏใใชใธ็งปๅใ
-* ไปฅไธใฎ`Dockerfile` ใไฝๆ:
+COPY ./app /code/app
-```Dockerfile
-FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
+CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
-COPY ./app /app
+# If running behind a proxy like Nginx or Traefik add --proxy-headers
+# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80", "--proxy-headers"]
```
-### ใใๅคงใใชใขใใชใฑใผใทใงใณ
+
-[Bigger Applications with Multiple Files](tutorial/bigger-applications.md){.internal-link target=_blank} ใปใฏใทใงใณใซๅฃใๅ ดๅใฏใ`Dockerfile` ใฏไธ่จใฎไปฃใใใซใไปฅไธใฎๆงใซใชใใใใใใพใใ:
+## ใณใณใใใจใฏไฝใ
-```Dockerfile
-FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
+ใณใณใใ๏ผไธปใซLinuxใณใณใใ๏ผใฏใๅใใทในใใ ๅ
ใฎไปใฎใณใณใใ๏ผไปใฎใขใใชใฑใผใทใงใณใใณใณใใผใใณใ๏ผใใ้้ขใใใ็ถๆ
ใไฟใกใชใใใใในใฆใฎไพๅญ้ขไฟใๅฟ
่ฆใชใใกใคใซใๅซใใขใใชใฑใผใทใงใณใใใใฑใผใธๅใใ้ๅธธใซ**่ปฝ้**ใชๆนๆณใงใใ
-COPY ./app /app/app
-```
+Linuxใณใณใใใฏใใในใ๏ผใใทใณใไปฎๆณใใทใณใใฏใฉใฆใใตใผใใผใชใฉ๏ผใฎๅใLinuxใซใผใใซใไฝฟ็จใใฆๅฎ่กใใใพใใใใใฏใ๏ผOSๅ
จไฝใใจใใฅใฌใผใใใๅฎๅ
จใชไปฎๆณใใทใณใจๆฏในใฆ๏ผ้ๅธธใซ่ปฝ้ใงใใใใจใๆๅณใใพใใ
-### Raspberry Piใชใฉใฎใขใผใญใใฏใใฃ
+ใใฎใใใซใใณใณใใใฏ**ใชใฝใผในใใปใจใใฉๆถ่ฒปใใพใใ**ใใใใญใปในใ็ดๆฅๅฎ่กใใใฎใซๅนๆตใใ้ใงใ๏ผไปฎๆณใใทใณใฏใใฃใจๆถ่ฒปใใพใ๏ผใ
-Raspberry Pi (ARMใใญใปใใตๆญ่ผ)ใใใไปฅๅคใฎใขใผใญใใฏใใฃใงDockerใไฝๅใใฆใใๅ ดๅใ(ใใซใใขใผใญใใฏใใฃใงใใ) Pythonใใผในใคใกใผใธใไฝฟใฃใฆใไธใใ`Dockerfile`ใไฝๆใใUvicornใๅไฝใงไฝฟ็จใงใใพใใ
+ใณใณใใใฏใพใใ็ฌ่ชใฎ**ๅ้ขใใใ**ๅฎ่กใใญใปใน๏ผ้ๅธธใฏ1ใคใฎใใญใปในใฎใฟ๏ผใใใใกใคใซใทในใใ ใใใใใฏใผใฏใๆใกใพใใ ใใฎใใจใฏใใใญใคใใปใญใฅใชใใฃใ้็บใชใฉใ็ฐก็ด ๅใใใพใใ
-ใใฎๅ ดๅใ`Dockerfile` ใฏไปฅไธใฎๆงใซใชใใใใใใพใใ:
+## ใณใณใใใปใคใกใผใธใจใฏไฝใ
-```Dockerfile
-FROM python:3.7
+**ใณใณใใ**ใฏใ**ใณใณใใใปใคใกใผใธ**ใใๅฎ่กใใใพใใ
-RUN pip install fastapi uvicorn
+ใณใณใใใปใคใกใผใธใฏใใณใณใใๅ
ใซๅญๅจใในใใในใฆใฎใใกใคใซใ็ฐๅขๅคๆฐใใใใฆใใใฉใซใใฎใณใใณใ/ใใญใฐใฉใ ใ**้็ใซ**ใใผใธใงใณๅใใใใฎใงใใ ใใใงใฎ**้็**ใจใฏใใณใณใใ**ใคใกใผใธ**ใฏๅฎ่กใใใฆใใใใใใใฑใผใธๅใใใใใกใคใซใจใกใฟใใผใฟใฎใฟใงใใใใจใๆๅณใใพใใ
-EXPOSE 80
+ไฟๅญใใใ้็ใณใณใใณใใงใใใ**ใณใณใใใคใกใผใธ**ใใจใฏๅฏพ็
ง็ใซใใ**ใณใณใใ**ใใฏ้ๅธธใๅฎ่กไธญใฎใคใณในใฟใณในใใคใพใ**ๅฎ่ก**ใใใฆใใใใฎใๆใใพใใ
-COPY ./app /app
+**ใณใณใใ**ใ่ตทๅใใๅฎ่กใใใใจใ๏ผ**ใณใณใใใคใกใผใธ**ใใ่ตทๅใใใใจใ๏ผใใใกใคใซใ็ฐๅขๅคๆฐใชใฉใไฝๆใใใใๅคๆดใใใใใใๅฏ่ฝๆงใใใใพใใ
-CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
+ใใใใฎๅคๆดใฏใใฎใณใณใใๅ
ใซใฎใฟๅญๅจใใพใใใๅบ็คใจใชใใณใณใใใปใคใกใผใธใซใฏๆฎใใพใใ๏ผใใฃในใฏใซไฟๅญใใใพใใ๏ผใ
+
+ใณใณใใใคใกใผใธใฏ **ใใญใฐใฉใ ** ใใกใคใซใใใฎๅ
ๅฎนใไพใใฐ `python` ใจ `main.py` ใใกใคใซใซๅนๆตใใพใใ
+
+ใใใฆใ**ใณใณใใ**่ชไฝใฏ๏ผ**ใณใณใใใคใกใผใธ**ใจใฏๅฏพ็
ง็ใซ๏ผใคใกใผใธใใใจใซใใๅฎ้ใฎๅฎ่กไธญใฎใคใณในใฟใณในใงใใใ**ใใญใปใน**ใซๅนๆตใใพใใ
+
+ๅฎ้ใใณใณใใใๅฎ่กใใใฆใใใฎใฏใ**ใใญใปในใๅฎ่กใใใฆใใ**ใจใใ ใใงใ๏ผ้ๅธธใฏๅไธใฎใใญใปในใ ใใงใ๏ผใ ใณใณใใๅ
ใงๅฎ่กไธญใฎใใญใปในใใชใๅ ดๅใใณใณใใใฏๅๆญขใใพใใ
+
+## ใณใณใใใปใคใกใผใธ
+
+Dockerใฏใ**ใณใณใใใปใคใกใผใธ**ใจ**ใณใณใใ**ใไฝๆใป็ฎก็ใใใใใฎไธป่ฆใชใใผใซใฎ1ใคใงใใ
+
+ใใใฆใDockerใซใฏDockerใคใกใผใธ๏ผใณใณใใ๏ผใๅ
ฑๆใใDocker Hubใจใใใใฎใใใใพใใ
+
+Docker Hubใฏ ๅคใใฎใใผใซใ็ฐๅขใใใผใฟใใผในใใขใใชใฑใผใทใงใณใซๅฏพๅฟใใฆใใไบใไฝๆใใใ**ๅ
ฌๅผใฎใณใณใใใปใคใกใผใธ**ใใใใชใใฏใซๆไพใใฆใใพใใ
+
+ไพใใฐใๅ
ฌๅผใคใกใผใธใฎ1ใคใซPython Imageใใใใพใใ
+
+ใใฎไปใซใใใใผใฟใใผในใชใฉใใพใใพใชใคใกใผใธใใใใพใ๏ผ
+
+* PostgreSQL
+* MySQL
+* MongoDB
+* Redis, etc.
+
+ไบใไฝๆใใใใณใณใใใปใคใกใผใธใไฝฟ็จใใใใจใงใ็ฐใชใใใผใซใ**็ตใฟๅใใใฆ**ไฝฟ็จใใใใจใ้ๅธธใซ็ฐกๅใซใชใใพใใไพใใฐใๆฐใใใใผใฟใใผในใ่ฉฆใๅ ดๅใซ็นใซไพฟๅฉใงใใใปใจใใฉใฎๅ ดๅใ**ๅ
ฌๅผใคใกใผใธ**ใไฝฟใใ็ฐๅขๅคๆฐใง่จญๅฎใใใ ใใง่ฏใใงใใ
+
+ใใใใใฐๅคใใฎๅ ดๅใใณใณใใใจDockerใซใคใใฆๅญฆใณใใใฎ็ฅ่ญใใใพใใพใชใใผใซใใณใณใใผใใณใใซใใฃใฆๅๅฉ็จใใใใจใใงใใพใใ
+
+ใคใพใใใใผใฟใใผในใPythonใขใใชใฑใผใทใงใณใReactใใญใณใใจใณใใปใขใใชใฑใผใทใงใณใๅใใใฆใงใใปใตใผใใผใชใฉใใใพใใพใชใใฎใ**่คๆฐใฎใณใณใใ**ใงๅฎ่กใใใใใใๅ
้จใใใใฏใผใฏ็ต็ฑใงๆฅ็ถใใพใใ
+
+ใในใฆใฎใณใณใใ็ฎก็ใทในใใ ๏ผDockerใKubernetesใชใฉ๏ผใซใฏใใใใใใใใใฏใผใญใณใฐๆฉ่ฝใ็ตฑๅใใใฆใใพใใ
+
+## ใณใณใใใจใใญใปใน
+
+้ๅธธใ**ใณใณใใใปใคใกใผใธ**ใฏใใฎใกใฟใใผใฟใซ**ใณใณใใ**ใฎ่ตทๅๆใซๅฎ่กใใใใใใฉใซใใฎใใญใฐใฉใ ใพใใฏใณใใณใใจใใใฎใใญใฐใฉใ ใซๆธกใใใใใฉใกใผใฟใๅซใฟใพใใใณใใณใใฉใคใณใงใฎๆไฝใจใใไผผใฆใใพใใ
+
+**ใณใณใใ**ใ่ตทๅใใใใจใใใฎใณใใณใ/ใใญใฐใฉใ ใๅฎ่กใใใพใ๏ผใใ ใใๅฅใฎใณใใณใ/ใใญใฐใฉใ ใใชใผใใผใฉใคใใใฆๅฎ่กใใใใใจใใงใใพใ๏ผใ
+
+ใณใณใใใฏใ**ใกใคใณใปใใญใปใน**๏ผใณใใณใใพใใฏใใญใฐใฉใ ๏ผใๅฎ่กใใใฆใใ้ใๅฎ่กใใใพใใ
+
+ใณใณใใใฏ้ๅธธ**1ใคใฎใใญใปใน**ใๆใกใพใใใใกใคใณใปใใญใปในใใใตใใปใใญใปในใ่ตทๅใใใใจใๅฏ่ฝใงใใใใใใฐๅใใณใณใใๅ
ใซ**่คๆฐใฎใใญใปใน**ใๆใคใใจใซใชใใพใใ
+
+ใใใใ**ๅฐใชใใจใ1ใคใฎๅฎ่กไธญใฎใใญใปใน**ใใชใใใฐใๅฎ่กไธญใฎใณใณใใใๆใคใใจใฏใงใใชใใงใใใกใคใณใปใใญใปในใๅๆญขใใใฐใใณใณใใใๅๆญขใใพใใ
+
+## Build a Docker Image for FastAPI
+
+ใจใใใใจใงใไฝใไฝใใพใใใ๏ผ๐
+
+FastAPI็จใฎ**Dockerใคใกใผใธ**ใใ**ๅ
ฌๅผPython**ใคใกใผใธใซๅบใฅใใฆ**ใผใญใใ**ใใซใใใๆนๆณใใ่ฆใใใพใใ
+
+ใใใฏ**ใปใจใใฉใฎๅ ดๅ**ใซใใใใใใจใงใใไพใใฐ๏ผ
+
+* **Kubernetes**ใพใใฏๅๆงใฎใใผใซใไฝฟ็จใใๅ ดๅ
+* **Raspberry Pi**ใงๅฎ่กใใๅ ดๅ
+* ใณใณใใใปใคใกใผใธใๅฎ่กใใฆใใใใฏใฉใฆใใปใตใผใในใชใฉใๅฉ็จใใๅ ดๅ
+
+### ใใใฑใผใธ่ฆไปถ๏ผpackage requirements๏ผ
+
+ใขใใชใฑใผใทใงใณใฎ**ใใใฑใผใธ่ฆไปถ**ใฏ้ๅธธใไฝใใใฎใใกใคใซใซ่จ่ฟฐใใใฆใใใฏใใงใใ
+
+ใใใฑใผใธ่ฆไปถใฏไธปใซ**ใคใณในใใผใซ**ใใใใใซไฝฟ็จใใใใผใซใซไพๅญใใใงใใใใ
+
+ๆใไธ่ฌ็ใชๆนๆณใฏใ`requirements.txt` ใใกใคใซใซใใใฑใผใธๅใจใใฎใใผใธใงใณใ 1 ่กใใคๆธใใใจใงใใ
+
+ใใกใใใ[FastAPI ใใผใธใงใณใซใคใใฆ](./versions.md){.internal-link target=_blank}ใง่ชญใใ ใฎใจๅใใขใคใใขใไฝฟ็จใใฆใใใผใธใงใณใฎ็ฏๅฒใ่จญๅฎใใพใใ
+
+ไพใใฐใ`requirements.txt` ใฏๆฌกใฎใใใซใชใใพใ๏ผ
+
+```
+fastapi>=0.68.0,<0.69.0
+pydantic>=1.8.0,<2.0.0
+uvicorn>=0.15.0,<0.16.0
```
-## **FastAPI** ใณใผใใฎไฝๆ
+ใใใฆ้ๅธธใไพใใฐ `pip` ใไฝฟใฃใฆใใใใฎใใใฑใผใธใฎไพๅญ้ขไฟใใคใณในใใผใซใใพใ๏ผ
+
+
-* `app` ใใฃใฌใฏใใชใไฝๆใใ็งปๅใ
-* ไปฅไธใฎ`main.py` ใใกใคใซใไฝๆ:
+```console
+$ pip install -r requirements.txt
+---> 100%
+Successfully installed fastapi pydantic uvicorn
+```
+
+
+
+!!! info
+ ใใใฑใผใธใฎไพๅญ้ขไฟใๅฎ็พฉใใคใณในใใผใซใใใใใฎใใฉใผใใใใใใผใซใฏไปใซใใใใพใใ
+
+ Poetryใไฝฟใฃใไพใฏใๅพ่ฟฐใใใปใฏใทใงใณใงใ็ดนไปใใพใใ๐
+
+### **FastAPI**ใณใผใใไฝๆใใ
+
+* `app` ใใฃใฌใฏใใชใไฝๆใใใใฎไธญใซๅ
ฅใใพใ
+* ็ฉบใฎใใกใคใซ `__init__.py` ใไฝๆใใพใ
+* `main.py` ใใกใคใซใไฝๆใใพใ๏ผ
```Python
-from typing import Optional
+from typing import Union
from fastapi import FastAPI
@@ -78,23 +164,136 @@ def read_root():
@app.get("/items/{item_id}")
-def read_item(item_id: int, q: Optional[str] = None):
+def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
```
-* ใใใงใฏใไปฅไธใฎๆงใชใใฃใฌใฏใใชๆง้ ใซใชใฃใฆใใใฏใใงใ:
+### Dockerfile
+
+ๅใใใญใธใงใฏใใปใใฃใฌใฏใใชใซ`Dockerfile`ใจใใใใกใคใซใไฝๆใใพใ๏ผ
+
+```{ .dockerfile .annotate }
+# (1)
+FROM python:3.9
+
+# (2)
+WORKDIR /code
+
+# (3)
+COPY ./requirements.txt /code/requirements.txt
+
+# (4)
+RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
+
+# (5)
+COPY ./app /code/app
+
+# (6)
+CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
+```
+
+1. ๅ
ฌๅผใฎPythonใใผในใคใกใผใธใใๅงใใพใ
+
+2. ็พๅจใฎไฝๆฅญใใฃใฌใฏใใชใ `/code` ใซ่จญๅฎใใพใ
+
+ ใใใซ `requirements.txt` ใใกใคใซใจ `app` ใใฃใฌใฏใใชใ็ฝฎใใพใใ
+
+3. ่ฆไปถใๆธใใใใใกใคใซใ `/code` ใใฃใฌใฏใใชใซใณใใผใใพใ
+
+ ๆฎใใฎใณใผใใงใฏใชใใๆๅใซๅฟ
่ฆใชใใกใคใซใ ใใใณใใผใใฆใใ ใใใ
+
+ ใใฎใใกใคใซใฏ**้ ป็นใซใฏๅคๆดใใใชใ**ใฎใงใDockerใฏใใฎในใใใใงใฏใใใๆค็ฅใ**ใญใฃใใทใฅ**ใไฝฟ็จใใๆฌกใฎในใใใใงใใญใฃใใทใฅใๆๅนใซใใพใใ
+
+4. ่ฆไปถใใกใคใซใซใใใใใฑใผใธใฎไพๅญ้ขไฟใใคใณในใใผใซใใพใ
+ `--no-cache-dir` ใชใใทใงใณใฏใใฆใณใญใผใใใใใใฑใผใธใใญใผใซใซใซไฟๅญใใชใใใใซ `pip` ใซๆ็คบใใพใใใใใฏใๅใใใใฑใผใธใใคใณในใใผใซใใใใใซ `pip` ใๅๅบฆๅฎ่กใใๅ ดๅใซใฎใฟๆๅนใงใใใใณใณใใใงไฝๆฅญใใๅ ดๅใฏใใใงใฏใชใใงใใ
+
+ !!! note
+ `--no-cache-dir`ใฏ`pip`ใซ้ข้ฃใใฆใใใ ใใงใDockerใใณใณใใใจใฏไฝใฎ้ขไฟใใชใใงใใ
+
+ `--upgrade` ใชใใทใงใณใฏใใใใฑใผใธใๆขใซใคใณในใใผใซใใใฆใใๅ ดๅใ`pip` ใซใขใใใฐใฌใผใใใใใใซๆ็คบใใพใใ
+
+ ไฝๆ
ใชใใใกใคใซใใณใใผใใๅใฎในใใใใฏ**Dockerใญใฃใใทใฅ**ใซใใฃใฆๆคๅบใใใๅฏ่ฝๆงใใใใใใงใใใใใฎในใใใใๅฉ็จๅฏ่ฝใชๅ ดๅใฏ**Dockerใญใฃใใทใฅ**ใไฝฟ็จใใพใใ
+
+ ใใฎในใใใใงใญใฃใใทใฅใไฝฟ็จใใใจใ้็บไธญใซใคใกใผใธใไฝๅบฆใใใซใใใ้ใซใ**ๆฏๅ**ใในใฆใฎไพๅญ้ขไฟใ**ใใฆใณใญใผใใใฆใคใณในใใผใซใใ**ไปฃใใใซๅคใใฎ**ๆ้**ใ**็ฏ็ด**ใงใใพใใ
+
+5. ./app` ใใฃใฌใฏใใชใ `/code` ใใฃใฌใฏใใชใฎไธญใซใณใใผใใใ
+
+ ใใใซใฏ**ๆใ้ ป็นใซๅคๆดใใใ**ใในใฆใฎใณใผใใๅซใพใใฆใใใใใDockerใฎ**ใญใฃใใทใฅ**ใฏ**ใใไปฅ้ใฎในใใใ**ใซ็ฐกๅใซไฝฟ็จใใใใใจใฏใใใพใใใ
+
+ ใใฎใใใใณใณใใใคใกใผใธใฎใใซใๆ้ใๆ้ฉๅใใใใใซใ`Dockerfile`ใฎ **ๆๅพ** ใซใใใ็ฝฎใใใจใ้่ฆใงใใ
+
+6. `uvicorn`ใตใผใใผใๅฎ่กใใใใใฎ**ใณใใณใ**ใ่จญๅฎใใพใ
+
+ `CMD` ใฏๆๅญๅใฎใชในใใๅใใใใใใใฎๆๅญๅใฏในใใผในใงๅบๅใใใใณใใณใใฉใคใณใซๅ
ฅๅใใใใฎใงใใ
+
+ ใใฎใณใใณใใฏ **็พๅจใฎไฝๆฅญใใฃใฌใฏใใช**ใใๅฎ่กใใใไธ่จใฎ `WORKDIR /code` ใซใฆ่จญๅฎใใ `/code` ใใฃใฌใฏใใชใจๅใใงใใ
+
+ ใใฎใใใใญใฐใฉใ ใฏ `/code` ใง้ๅงใใใฎไธญใซใใชใใฎใณใผใใใใ `./app` ใใฃใฌใฏใใชใใใใฎใงใ**Uvicorn** ใฏ `app.main` ใใ `app` ใๅ็
งใใ**ใคใณใใผใ** ใใใใจใใงใใพใใ
+
+!!! tip
+ ใณใผใๅ
ใฎ"+"ใฎๅนใๅบใใใฏใชใใฏใใฆใๅ่กใไฝใใใใฎใใใฌใใฅใผใใฆใใ ใใใ๐
+
+ใใใงใๆฌกใฎใใใชใใฃใฌใฏใใชๆง้ ใซใชใใฏใใงใ๏ผ
```
.
โโโ app
+โย ย โโโ __init__.py
โ โโโ main.py
-โโโ Dockerfile
+โโโ Dockerfile
+โโโ requirements.txt
+```
+
+#### TLS Termination Proxyใฎ่ฃๅด
+
+Nginx ใ Traefik ใฎใใใช TLS Termination Proxy (ใญใผใใใฉใณใต) ใฎๅพใใงใณใณใใใๅใใใฆใใๅ ดๅใฏใ`--proxy-headers`ใชใใทใงใณใ่ฟฝๅ ใใพใใ
+
+ใใฎใชใใทใงใณใฏใUvicornใซใใญใญใท็ต็ฑใงHTTPSใงๅไฝใใฆใใใขใใชใฑใผใทใงใณใซๅฏพใใฆใ้ไฟกใใใใใใใไฟก้ ผใใใใๆ็คบใใพใใ
+
+```Dockerfile
+CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]
+```
+
+#### Dockerใญใฃใใทใฅ
+
+ใใฎ`Dockerfile`ใซใฏ้่ฆใชใใชใใฏใใใใใพใ**ไพๅญ้ขไฟใ ใใฎใใกใคใซ**ใใณใใผใใพใใใใฎ็็ฑใ่ชฌๆใใพใใ
+
+```Dockerfile
+COPY ./requirements.txt /code/requirements.txt
+```
+
+Dockerใไปใฎใใผใซใฏใใใใใฎใณใณใใใคใกใผใธใ**ๆฎต้็ใซ**ใใซใใใ**1ใคใฎใฌใคใคใผใไปใฎใฌใคใคใผใฎไธใซ**่ฟฝๅ ใใพใใ`Dockerfile`ใฎๅ
้ ญใใ้ๅงใใ`Dockerfile`ใฎๅๅฝไปคใซใใฃใฆไฝๆใใใใใกใคใซใ่ฟฝๅ ใใฆใใใพใใ
+
+Dockerใๅๆงใฎใใผใซใฏใใคใกใผใธใใใซใใใ้ใซ**ๅ
้จใญใฃใใทใฅ**ใไฝฟ็จใใพใใๅๅใณใณใใใคใกใผใธใๆง็ฏใใใจใใใใใกใคใซใๅคๆดใใใฆใใชใๅ ดๅใใใกใคใซใๅๅบฆใณใใผใใฆใผใญใใๆฐใใใฌใคใคใผใไฝๆใใไปฃใใใซใ**ๅๅไฝๆใใๅใใฌใคใคใผใๅๅฉ็จ**ใใพใใ
+
+ใใ ใใกใคใซใฎใณใใผใ้ฟใใใ ใใงใฏใใพใๆนๅใใใพใใใใใใฎในใใใใงใญใฃใใทใฅใๅฉ็จใใใใใ**ๆฌกใฎในใใใ**ใงใญใฃใใทใฅใไฝฟใใใจใใงใใพใใ
+
+ไพใใฐใไพๅญ้ขไฟใใคใณในใใผใซใใๅฝไปคใฎใใใซใญใฃใใทใฅใไฝฟใใใจใใงใใพใ๏ผ
+
+```Dockerfile
+RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
```
-## Dockerใคใกใผใธใใใซใ
+ใใใฑใผใธ่ฆไปถใฎใใกใคใซใฏ**้ ป็นใซๅคๆดใใใใใจใฏใใใพใใ**ใใใฎใใใใใฎใใกใคใซใ ใใใณใใผใใใใจใงใDockerใฏใใฎในใใใใงใฏ**ใญใฃใใทใฅ**ใไฝฟ็จใใใใจใใงใใพใใ
+
+ใใใฆใDockerใฏ**ๆฌกใฎในใใใใฎใใใซใญใฃใใทใฅ**ใไฝฟ็จใใใใใใฎไพๅญ้ขไฟใใใฆใณใญใผใใใฆใคใณในใใผใซใใใใจใใงใใพใใใใใฆใใใใง**ๅคใใฎๆ้ใ็ฏ็ด**ใใพใใโจ ...ใใใฆ้ๅฑใชๅพ
ใกๆ้ใ้ฟใใใใจใใงใใพใใ๐ช๐
+
+ใใใฑใผใธใฎไพๅญ้ขไฟใใใฆใณใญใผใใใฆใคใณในใใผใซใใใซใฏ**ๆฐๅ**ใใใใพใใใ**ใญใฃใใทใฅ**ใไฝฟใใฐ**ใใใใๆฐ็ง**ใงใใ
-* ใใญใธใงใฏใใใฃใฌใฏใใช (`app` ใใฃใฌใฏใใชใๅซใใ ใ`Dockerfile` ใฎใใๅ ดๆ) ใธ็งปๅ
-* FastAPIใคใกใผใธใฎใใซใ:
+ๅ ใใฆใ้็บไธญใซใณใณใใใปใคใกใผใธใไฝๅบฆใใใซใใใฆใใณใผใใฎๅคๆดใๆฉ่ฝใใฆใใใใฉใใใใใงใใฏใใใใจใซใชใใใใๅคใใฎๆ้ใ็ฏ็ดใใใใจใใงใใพใใ
+
+ใใใฆ`Dockerfile`ใฎๆ็ต่กใฎ่ฟใใงใในใฆใฎใณใผใใใณใใผใใพใใใใฎ็็ฑใฏใ**ๆใ้ ป็นใซ**ๅคๆดใใใใใฎใชใฎใงใใใฎในใใใใฎๅพใซใใใใฎใฏใปใจใใฉใญใฃใใทใฅใไฝฟ็จใใใใจใใงใใชใใฎใใใงใใ
+
+```Dockerfile
+COPY ./app /code/app
+```
+
+### Dockerใคใกใผใธใใใซใใใ
+
+ใในใฆใฎใใกใคใซใๆใฃใใฎใงใใณใณใใใปใคใกใผใธใใใซใใใพใใใใ
+
+* ใใญใธใงใฏใใใฃใฌใฏใใชใซ็งปๅใใพใ๏ผ`Dockerfile`ใใใๅ ดๆใงใ`app`ใใฃใฌใฏใใชใใใใพใ๏ผ
+* FastAPI ใคใกใผใธใใใซใใใพใ๏ผ
@@ -106,9 +305,14 @@ $ docker build -t myimage .
-## Dockerใณใณใใใ่ตทๅ
+!!! tip
+ ๆซๅฐพใฎ `.` ใซๆณจ็ฎใใฆใปใใใงใใใใใฏ `./` ใจๅใๆๅณใงใใ ใใใฏDockerใซใณใณใใใคใกใผใธใฎใใซใใซไฝฟ็จใใใใฃใฌใฏใใชใๆ็คบใใพใใ
+
+ ใใฎๅ ดๅใๅใใซใฌใณใใปใใฃใฌใฏใใช(`.`)ใงใใ
-* ็จๆใใใคใกใผใธใๅบใซใใใณใณใใใฎ่ตทๅ:
+### Dockerใณใณใใใฎ่ตทๅใใ
+
+* ใคใกใผใธใซๅบใฅใใฆใณใณใใใๅฎ่กใใพใ๏ผ
@@ -118,62 +322,394 @@ $ docker run -d --name mycontainer -p 80:80 myimage
-ใใใงใDockerใณใณใใๅ
ใซๆ้ฉๅใใใFastAPIใตใผใใๅไฝใใฆใใพใใไฝฟ็จใใฆใใใตใผใ (ใใใฆCPUใณใขๆฐ) ใซๆฒฟใฃใ่ชๅใใฅใผใใณใฐใ่กใใใฆใใพใใ
-
-## ็ขบ่ช
+## ็ขบ่ชใใ
-DockerใณใณใใใฎURLใง็ขบ่ชใงใใใฏใใงใใไพใใฐ: http://192.168.99.100/items/5?q=somequery ใ http://127.0.0.1/items/5?q=somequery (ใใใใฏDockerใในใใไฝฟ็จใใใใใใจๅ็ญใฎใใฎ)ใ
+Dockerใณใณใใใฎhttp://192.168.99.100/items/5?q=somequery ใ http://127.0.0.1/items/5?q=somequery (ใพใใฏใใใซ็ธๅฝใใDockerใในใใไฝฟ็จใใใใฎ๏ผใจใใฃใURLใง็ขบ่ชใงใใใฏใใงใใ
-ไปฅไธใฎๆงใชใใฎใ่ฟใใใพใ:
+ใขใฏใปในใใใจไปฅไธใฎใใใชใใฎใ่กจ็คบใใใพใ๏ผ
```JSON
{"item_id": 5, "q": "somequery"}
```
-## ๅฏพ่ฉฑ็APIใใญใฅใกใณใ
+## ใคใณใฟใฉใฏใใฃใใชAPIใใญใฅใกใณใ
-ใใใงใhttp://192.168.99.100/docs ใ http://127.0.0.1/docs (ใใใใฏDockerใในใใไฝฟ็จใใใใใใจๅ็ญใฎใใฎ) ใ้ใใฆไธใใใ
+ใใใใฎURLใซใใขใฏใปในใงใใพใ: http://192.168.99.100/docs ใ http://127.0.0.1/docs (ใพใใฏใใใซ็ธๅฝใใDockerใในใใไฝฟ็จใใใใฎ๏ผ
-่ชๅ็ๆใใใๅฏพ่ฉฑ็APIใใญใฅใกใณใใ็ขบ่ชใงใใพใ (Swagger UIใซใใฃใฆๆไพใใใพใ):
+ใขใฏใปในใใใจใ่ชๅๅฏพ่ฉฑๅAPIใใญใฅใกใณใ๏ผSwagger UIใๆไพ๏ผใ่กจ็คบใใใพใ๏ผ

-## ใใฎไปใฎAPIใใญใฅใกใณใ
+## ไปฃๆฟใฎAPIใใญใฅใกใณใ
-ใพใๅๆงใซใhttp://192.168.99.100/redoc ใ http://127.0.0.1/redoc (ใใใใฏDockerใในใใไฝฟ็จใใใใใใจๅ็ญใฎใใฎ) ใ้ใใฆไธใใใ
+ใพใใhttp://192.168.99.100/redoc ใ http://127.0.0.1/redoc (ใพใใฏใใใซ็ธๅฝใใDockerใในใใไฝฟ็จใใใใฎ๏ผใซใใขใฏใปในใงใใพใใ
-ไปใฎ่ชๅ็ๆใใใๅฏพ่ฉฑ็ใชAPIใใญใฅใกใณใใ็ขบ่ชใงใใพใ (ReDocใซใใฃใฆๆไพใใใพใ):
+ไปฃๆฟใฎ่ชๅใใญใฅใกใณใ๏ผReDocใซใใฃใฆๆไพใใใ๏ผใ่กจ็คบใใใพใ๏ผ

-## Traefik
+## ๅไธใใกใคใซใฎFastAPIใงDockerใคใกใผใธใใใซใใใ
+
+FastAPI ใๅไธใฎใใกใคใซใไพใใฐ `./app` ใใฃใฌใฏใใชใฎใชใ `main.py` ใฎๅ ดๅใใใกใคใซๆง้ ใฏๆฌกใฎใใใซใชใใพใ๏ผ
+```
+.
+โโโ Dockerfile
+โโโ main.py
+โโโ requirements.txt
+```
+
+ใใใใใฐใ`Dockerfile`ใฎไธญใซใใกใคใซใใณใใผใใใใใซใๅฏพๅฟใใใในใๅคๆดใใใ ใใงใใใงใ๏ผ
+
+```{ .dockerfile .annotate hl_lines="10 13" }
+FROM python:3.9
+
+WORKDIR /code
+
+COPY ./requirements.txt /code/requirements.txt
+
+RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
+
+# (1)
+COPY ./main.py /code/
+
+# (2)
+CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
+```
+
+1. main.py`ใใกใคใซใ `/code` ใใฃใฌใฏใใชใซ็ดๆฅใณใใผใใพใใ
+
+2. Uvicornใๅฎ่กใใ`main`ใใ`app`ใชใใธใงใฏใใใคใณใใผใใใใใใซๆ็คบใใพใ๏ผ`app.main`ใใใคใณใใผใใใใฎใงใฏใชใ๏ผใ
+
+ๆฌกใซUvicornใณใใณใใ่ชฟๆดใใฆใ`app.main` ใฎไปฃใใใซๆฐใใใขใธใฅใผใซ `main` ใไฝฟ็จใใFastAPIใชใใธใงใฏใใงใใ `app` ใใคใณใใผใใใพใใ
+
+## ใใใญใคใกใณใใฎใณใณใปใใ
+
+ใณใณใใใจใใ่ฆณ็นใใใ[ใใใญใคใฎใณใณใปใใ](./concepts.md){.internal-link target=_blank}ใซๅ
ฑ้ใใใใใคใใซใคใใฆใใใไธๅบฆ่ชฌๆใใพใใใใ
+
+ใณใณใใใฏไธปใซใใขใใชใฑใผใทใงใณใฎ**ใใซใใจใใใญใค**ใฎใใญใปในใ็ฐก็ด ๅใใใใใฎใใผใซใงใใใใใใใฎ**ใใใญใคใฎใณใณใปใใ**ใๆฑใใใใฎ็นๅฎใฎใขใใญใผใใๅผทๅถใใใใฎใงใฏใชใใงใใ
-Traefikใฏใ้ซๆง่ฝใชใชใใผในใใญใญใท/ใญใผใใใฉใณใตใผใงใใใTLSใฟใผใใใผใทใงใณใใญใญใทใใธใงใใๅฎ่กใงใใพใ๏ผไปใฎๆฉ่ฝใจๅใ้ขใใฆ๏ผใ
+**่ฏใใใฅใผใน**ใฏใใใใใใฎ็ฐใชใๆฆ็ฅใซใฏใใในใฆใฎใใใญใคใกใณใใฎใณใณใปใใใใซใใผใใๆนๆณใใใใจใใใใจใงใใ๐
-Let's Encryptใจ็ตฑๅใใใฆใใพใใใใฎใใใ่จผๆๆธใฎๅๅพใจๆดๆฐใๅซใHTTPSใซ้ขใใใในใฆใฎๅฆ็ใๅฎ่กใงใใพใใ
+ใใใใฎ**ใใใญใคใกใณใใฎใณใณใปใใ**ใใณใณใใใฎ่ฆณ็นใใ่ฆ็ดใใฆใฟใพใใใ๏ผ
-ใพใใDockerใจใ็ตฑๅใใใฆใใพใใใใใใฃใฆใๅใขใใชใฑใผใทใงใณๆงๆใงใใกใคใณใๅฎฃ่จใใใใใใฎๆงๆใ่ชญใฟๅใฃใฆใHTTPS่จผๆๆธใ็ๆใใๆงๆใซๅคๆดใๅ ใใใใจใชใใใขใใชใฑใผใทใงใณใซHTTPSใ่ชๅ็ใซๆไพใงใใพใใ
+* ใปใญใฅใชใใฃ - HTTPS
+* ่ตทๅๆใฎๅฎ่ก
+* ๅ่ตทๅ
+* **ใฌใใชใฑใผใทใงใณ๏ผๅฎ่กไธญใฎใใญใปในๆฐ๏ผ**
+* ใกใขใช
+* ้ๅงๅใฎไบๅในใใใ
+
+## HTTPS
+
+FastAPI ใขใใชใฑใผใทใงใณใฎ **ใณใณใใใปใคใกใผใธ**๏ผใใใณๅพใงๅฎ่กไธญใฎ **ใณใณใใ**๏ผใ ใใซ็ฆ็นใๅฝใฆใใจใ้ๅธธใHTTPSใฏๅฅใฎใใผใซใ็จใใฆ**ๅค้จใง**ๅฆ็ใใใพใใ
+
+ไพใใฐTraefikใฎใใใซใ**HTTPS**ใจ**่จผๆๆธ**ใฎ**่ชๅ**ๅๅพใๆฑใๅฅใฎใณใณใใใงใใๅฏ่ฝๆงใใใใพใใ
+
+!!! tip
+ TraefikใฏDockerใKubernetesใชใฉใจ็ตฑๅใใใฆใใใฎใงใใณใณใใ็จใฎHTTPSใฎ่จญๅฎใๆงๆใฏใจใฆใ็ฐกๅใงใใ
+
+ใใใใฏใ๏ผใณใณใใๅ
ใงใขใใชใฑใผใทใงใณใๅฎ่กใใชใใ๏ผใฏใฉใฆใใปใใญใใคใใผใใตใผใในใฎ1ใคใจใใฆHTTPSใๅฆ็ใใใใจใใงใใพใใ
+
+## ่ตทๅๆใใใณๅ่ตทๅๆใฎๅฎ่ก
+
+้ๅธธใใณใณใใใฎ**่ตทๅใจๅฎ่ก**ใๆ
ๅฝใใๅฅใฎใใผใซใใใใพใใ
+
+ใใใฏ็ดๆฅ**Docker**ใงใใฃใใใ**Docker Compose**ใงใใฃใใใ**Kubernetes**ใงใใฃใใใ**ใฏใฉใฆใใตใผใใน**ใงใใฃใใใใพใใ
+
+ใปใจใใฉใฎๅ ดๅ๏ผใพใใฏใในใฆใฎๅ ดๅ๏ผใ่ตทๅๆใซใณใณใใใๅฎ่กใใๅคฑๆๆใซๅ่ตทๅใๆๅนใซใใ็ฐกๅใชใชใใทใงใณใใใใพใใไพใใฐDockerใงใฏใใณใใณใใฉใคใณใชใใทใงใณใฎ`--restart`ใ่ฉฒๅฝใใพใใ
+
+ใณใณใใใไฝฟใใชใใใฐใใขใใชใฑใผใทใงใณใ่ตทๅๆใๅ่ตทๅๆใซๅฎ่กใใใใฎใฏ้ขๅใง้ฃใใใใใใใพใใใใใใใ**ใณใณใใ**ใงไฝๆฅญใใๅ ดๅใใปใจใใฉใฎใฑใผในใงใใฎๆฉ่ฝใฏใใใฉใซใใงๅซใพใใฆใใพใใโจ
+
+## ใฌใใชใฑใผใทใงใณ - ใใญใปในๆฐ
+
+**Kubernetes** ใ Docker Swarm ใขใผใใNomadใใใใใฏ่คๆฐใฎใใทใณไธใงๅๆฃใณใณใใใ็ฎก็ใใใใใฎๅๆงใฎ่ค้ใชใทในใใ ใไฝฟใฃใฆใใทใณใฎใฏใฉในใฟใผใๆงๆใใฆใใๅ ดๅใ ๅใณใณใใใง๏ผWorkerใๆใคGunicornใฎใใใช๏ผ**ใใญใปในใใใผใธใฃ**ใไฝฟ็จใใไปฃใใใซใ**ใฏใฉในใฟใผใปใฌใใซ**ใง**ใฌใใชใฑใผใทใงใณ**ใๅฆ็ใใใใจๆใใงใใใใ
+
+Kubernetesใฎใใใชๅๆฃใณใณใใ็ฎก็ใทในใใ ใฎ1ใคใฏ้ๅธธใๅ
ฅใฃใฆใใใชใฏใจในใใฎ**ใญใผใใใฉใณใทใณใฐ**ใใตใใผใใใชใใใ**ใณใณใใใฎใฌใใชใฑใผใทใงใณ**ใๅฆ็ใใ็ตฑๅใใใๆนๆณใๆใฃใฆใใพใใใใฎใใจใฏใในใฆ**ใฏใฉในใฟใฌใใซ**ใซใฆใงใใ
+
+ใใฎใใใชๅ ดๅใUvicornใฏใผใซใผใงGunicornใฎใใใชใใฎใๅฎ่กใใใฎใงใฏใชใใ[ไธ่จใฎ่ชฌๆ](#dockerfile)ใฎใใใซ**Dockerใคใกใผใธใใผใญใใ**ใใซใใใไพๅญ้ขไฟใใคใณในใใผใซใใฆใ**ๅไธใฎUvicornใใญใปใน**ใๅฎ่กใใใใงใใใใ
+
+### ใญใผใใใฉใณใตใผ
+
+ใณใณใใใไฝฟ็จใใๅ ดๅใ้ๅธธใฏใกใคใณใปใใผใ**ใงใชในใใณใฐ**ใใฆใใใณใณใใผใใณใใใใใฏใใงใใใใใฏใใใใใ**HTTPS**ใๅฆ็ใใใใใฎ**TLS Termination Proxy**ใงใใใๅฅใฎใณใณใใใงใใฃใใใๅๆงใฎใใผใซใงใใฃใใใใใงใใใใ
+
+ใใฎใณใณใใผใใณใใฏใชใฏใจในใใฎ **่ฒ ่ท** ใๅใใ (ใใพใใใใฐ) ใใฎ่ฒ ่ทใ**ใใฉใณในใใ** ใฏใผใซใผใซๅ้
ใใใฎใงใไธ่ฌใซ **ใญใผใใใฉใณใต** ใจใๅผใฐใใพใใ
+
+!!! tip
+ใใHTTPSใซไฝฟใใใใใฎใจๅใ**TLS Termination Proxy**ใณใณใใผใใณใใฏใใใใใ**ใญใผใใใฉใณใตใผ**ใซใใชใใงใใใใ
+
+ใใใฆใณใณใใใงไฝๆฅญใใๅ ดๅใใณใณใใใฎ่ตทๅใจ็ฎก็ใซไฝฟ็จใใๅใใทในใใ ใซใฏใ**ใญใผใใใฉใณใตใผ**๏ผ**TLS Termination Proxy**ใฎๅฏ่ฝๆงใใใ๏ผใใ**ใใใใฏใผใฏ้ไฟก**๏ผHTTPใชใฏใจในใใชใฉ๏ผใใขใใชใฎใใใณใณใใ๏ผ่คๆฐๅฏ๏ผใซ้ไฟกใใใใใฎๅ
้จใใผใซใๆขใซใใใฏใใงใใ
+
+### 1ใคใฎใญใผใใใฉใณใตใผ - ่คๆฐใฎใฏใผใซใผใณใณใใใผ
+
+**Kubernetes**ใๅๆงใฎๅๆฃใณใณใใ็ฎก็ใทในใใ ใงไฝๆฅญใใๅ ดๅใใใฎๅ
้จใฎใใใใฏใผใญใณใฐใฎใกใซใใบใ ใไฝฟ็จใใใใจใงใใกใคใณใฎ**ใใผใ**ใงใชใในใณใใฆใใๅไธใฎ**ใญใผใใใฉใณใตใผ**ใใใขใใชใๅฎ่กใใฆใใๅฏ่ฝๆงใฎใใ**่คๆฐใฎใณใณใใ**ใซ้ไฟก๏ผใชใฏใจในใ๏ผใ้ไฟกใงใใใใใซใชใใพใใ
+
+ใขใใชใๅฎ่กใใใใใใฎใณใณใใใซใฏใ้ๅธธ**1ใคใฎใใญใปใน**๏ผใใจใใฐใFastAPIใขใใชใฑใผใทใงใณใๅฎ่กใใUvicornใใญใปใน๏ผใใใใพใใใใใใฏใในใฆ**ๅไธใฎใณใณใใ**ใงใใๅใใใฎใๅฎ่กใใพใใใใใใใใ็ฌ่ชใฎใใญใปในใใกใขใชใชใฉใๆใกใพใใใใใใใใจใงใCPUใฎ**็ฐใชใใณใข**ใใใใใฏ**็ฐใชใใใทใณ**ใงใฎ**ไธฆๅๅ**ใๅฉ็จใงใใพใใ
+
+ใใใฆใ**ใญใผใใใฉใณใตใผ**ใๅใใๅๆฃใณใณใใใทในใใ ใฏใ**้ ็ชใซ**ใใชใใฎใขใใชใๅซใๅใณใณใใใซ**ใชใฏใจในใใๅ้
**ใใพใใใคใพใใๅใชใฏใจในใใฏใใใชใใฎใขใใชใๅฎ่กใใฆใใ่คๆฐใฎ**ใฌใใชใฑใผใใใใใณใณใใ**ใฎ1ใคใซใใฃใฆๅฆ็ใใใพใใ
+
+ใใใฆ้ๅธธใใใฎ**ใญใผใใใฉใณใตใผ**ใฏใใฏใฉในใฟๅ
ใฎ*ไปใฎ*ใขใใชใฑใผใทใงใณ๏ผไพใใฐใ็ฐใชใใใกใคใณใ็ฐใชใURLใในใฎใใฌใใฃใใฏในใฎ้
ไธ๏ผใธใฎใชใฏใจในใใๅฆ็ใใใใจใใงใใใใฎ้ไฟกใใฏใฉในใฟๅ
ใงๅฎ่กใใใฆใใ*ไปใฎ*ใขใใชใฑใผใทใงใณใฎใใใฎ้ฉๅใชใณใณใใใซ้ไฟกใใพใใ
+
+### 1ใณใณใใใซใคใ1ใใญใปใน
+
+ใใฎ็จฎใฎใทใใชใชใงใฏใใใงใซใฏใฉในใฟใปใฌใใซใงใฌใใชใฑใผใทใงใณใๅฆ็ใใฆใใใใใใใใใใณใณใใใใจใซ**ๅไธใฎ๏ผUvicorn๏ผใใญใปใน**ใๆใกใใใงใใใใ
+
+ใใฎๅ ดๅใUvicornใฏใผใซใผใๆใคGunicornใฎใใใชใใญใปในใใใผใธใฃใผใใUvicornใฏใผใซใผใไฝฟใUvicornใฏ**้ฟใใใ**ใงใใใใ**ใณใณใใใใจใซUvicornใฎใใญใปในใฏ1ใคใ ใ**ใซใใใใงใใใ๏ผใใใใ่คๆฐใฎใณใณใใใๅฟ
่ฆใงใใใ๏ผใ
+
+๏ผGunicornใUvicornใUvicornใฏใผใซใผใ็ฎก็ใใใใใซ๏ผใณใณใใๅ
ใซๅฅใฎใใญใปในใใใผใธใฃใผใๆใคใใจใฏใใฏใฉในใฟใผใทในใใ ใงใใงใซๅฏพๅฆใใฆใใใงใใใ**ไธ่ฆใช่ค้ใ**ใ่ฟฝๅ ใใใ ใใงใใ
+
+### Containers with Multiple Processes and Special Cases
+
+ใใกใใใ**็นๆฎใชใฑใผใน**ใจใใฆใ**Gunicornใใญใปในใใใผใธใฃ**ใๆใค**ใณใณใใ**ๅ
ใง่คๆฐใฎ**Uvicornใฏใผใซใผใใญใปใน**ใ่ตทๅใใใใๅ ดๅใใใใพใใ
+
+ใใฎใใใชๅ ดๅใ**ๅ
ฌๅผใฎDockerใคใกใผใธ**ใไฝฟ็จใใใใจใใงใใพใใใใฎใคใกใผใธใซใฏใ่คๆฐใฎ**Uvicornใฏใผใซใผใใญใปใน**ใๅฎ่กใใใใญใปในใใใผใธใฃใจใใฆ**Gunicorn**ใๅซใพใใฆใใใ็พๅจใฎCPUใณใขใซๅบใฅใใฆใฏใผใซใผใฎๆฐใ่ชๅ็ใซ่ชฟๆดใใใใใฎใใใฉใซใ่จญๅฎใใใใคใๅซใพใใฆใใพใใ่ฉณใใใฏๅพ่ฟฐใฎ[Gunicornใซใใๅ
ฌๅผDockerใคใกใผใธ - Uvicorn](#gunicornใซใใๅ
ฌๅผdockerใคใกใผใธ---Uvicorn)ใง่ชฌๆใใพใใ
+
+ไปฅไธใฏใใใใ็ใซใใชใฃใฆใใๅ ดๅใฎไพใงใ๏ผ
+
+#### ใทใณใใซใชใขใใชใฑใผใทใงใณ
+
+ใขใใชใฑใผใทใงใณใ**ใทใณใใซ**ใชๅฝขใงๅฎ่กใใๅ ดๅใใใญใปในๆฐใฎ็ดฐใใ่ชฟๆดใๅฟ
่ฆใชใๅ ดๅใ่ชๅๅใใใใใใฉใซใใไฝฟ็จใใใ ใใงใใณใณใใๅ
ใซใใญใปในใใใผใธใฃใๅฟ
่ฆใใใใใพใใใไพใใฐใๅ
ฌๅผDockerใคใกใผใธใงใทใณใใซใช่จญๅฎใๅฏ่ฝใงใใ
+
+#### Docker Compose
+
+Docker Composeใง**ใทใณใฐใซใตใผใ**๏ผใฏใฉในใฟใงใฏใชใ๏ผใซใใใญใคใใใใจใใงใใพใใฎใงใๅ
ฑๆใใใใฏใผใฏใจ**ใญใผใใใฉใณใทใณใฐ**ใ็ถญๆใใชใใ๏ผDocker Composeใง๏ผใณใณใใใฎใฌใใชใฑใผใทใงใณใ็ฎก็ใใ็ฐกๅใชๆนๆณใฏใชใใงใใใใ
+
+ใใฎๅ ดๅใ**ๅไธใฎใณใณใใ**ใงใ**ใใญใปในใใใผใธใฃ**ใๅ
้จใง**่คๆฐใฎใฏใผใซใผใใญใปใน**ใ่ตทๅใใใใใซใใพใใ
+
+#### Prometheusใจใใฎไปใฎ็็ฑ
+
+ใพใใ**1ใคใฎใณใณใใ**ใซ**1ใคใฎใใญใปใน**ใๆใใใใฎใงใฏใชใใ**1ใคใฎใณใณใใ**ใซ**่คๆฐใฎใใญใปใน**ใๆใใใๆนใ็ฐกๅใ ใจใใ**ไปใฎ็็ฑ**ใใใใงใใใใ
+
+ไพใใฐใ(ใปใใใขใใใซใใใใพใใ)Prometheusใจใฏในใใผใฟใผใฎใใใชใใผใซใๅใใณใณใใๅ
ใซๆใคใใจใใงใใพใใ
+
+ใใฎๅ ดๅใ**่คๆฐใฎใณใณใใ**ใใใใจใใใใฉใซใใงใฏใPrometheusใ**ใกใใชใฏในใ**่ชญใฟใซๆฅใใจใใใในใฆใฎใฌใใชใฑใผใใใใใณใณใใใฎ**่็ฉใใใใกใใชใฏใน**ใๅๅพใใใฎใงใฏใชใใๆฏๅ**ๅไธใฎใณใณใใ**๏ผใใฎ็นๅฎใฎใชใฏใจในใใๅฆ็ใใใณใณใใ๏ผใฎใใฎใๅๅพใใใใจใซใชใใพใใ
+
+ใใฎๅ ดๅใ**่คๆฐใฎใใญใปใน**ใๆใค**1ใคใฎใณใณใใ**ใ็จๆใใๅใใณใณใใไธใฎใญใผใซใซใใผใซ๏ผไพใใฐPrometheusใจใฏในใใผใฟใผ๏ผใใในใฆใฎๅ
้จใใญใปในใฎPrometheusใกใใชใฏในใๅ้ใใใใฎ1ใคใฎใณใณใใไธใงใใใใฎใกใใชใฏในใๅ
ฌ้ใใๆนใใทใณใใซใใใใใพใใใ
---
-ๆฌกใฎใปใฏใทใงใณใซ้ฒใฟใใใฎๆ
ๅ ฑใจใใผใซใไฝฟ็จใใฆใใในใฆใ็ตใฟๅใใใพใใ
+้่ฆใชใฎใฏใ็ฒ็ฎ็ใซๅพใใชใใใฐใชใใชใๆฎ้ใฎใซใผใซใฏใชใใจใใใใจใงใใ
+
+ใใใใฎใขใคใใขใฏใ**ใใชใ่ช่บซใฎใฆใผในใฑใผใน**ใ่ฉไพกใใใใชใใฎใทในใใ ใซๆ้ฉใชใขใใญใผใใๆฑบๅฎใใใใใซไฝฟ็จใใใใจใใงใใพใ๏ผ
+
+* ใปใญใฅใชใใฃ - HTTPS
+* ่ตทๅๆใฎๅฎ่ก
+* ๅ่ตทๅ
+* **ใฌใใชใฑใผใทใงใณ๏ผๅฎ่กไธญใฎใใญใปในๆฐ๏ผ**
+* ใกใขใช
+* ้ๅงๅใฎไบๅในใใใ
+
+## ใกใขใชใผ
+
+ใณใณใใใใจใซ**ๅไธใฎใใญใปในใๅฎ่กใใ**ใจใใใใใฎใณใณใใ๏ผใฌใใชใฑใผใใใใฆใใๅ ดๅใฏ1ใคไปฅไธ๏ผใซใใฃใฆๆถ่ฒปใใใๅคใใๅฐใชใใๆ็ขบใซๅฎ็พฉใใใใๅฎๅฎใๅถ้ใใใ้ใฎใกใขใชใๆใคใใจใซใชใใพใใ
+
+ใใใฆใใณใณใใ็ฎก็ใทในใใ ๏ผ**Kubernetes**ใชใฉ๏ผใฎ่จญๅฎใงใๅใใกใขใชๅถ้ใจ่ฆไปถใ่จญๅฎใใใใจใใงใใพใใ
+
+ใใใใใฐใใณใณใใใๅฟ
่ฆใจใใใกใขใช้ใจใฏใฉในใฟๅ
ใฎใใทใณใงๅฉ็จๅฏ่ฝใชใกใขใช้ใ่ๆ
ฎใใฆใ**ๅฉ็จๅฏ่ฝใชใใทใณ**ใซ**ใณใณใใ**ใใฌใใชใฑใผใใงใใใใใซใชใใพใใ
+
+ใขใใชใฑใผใทใงใณใ**ใทใณใใซ**ใชใใฎใงใใใฐใใใใฏใใใใ**ๅ้กใซใฏใชใใชใ**ใงใใใใใใใผใใชใกใขใชๅถ้ใๆๅฎใใๅฟ
่ฆใฏใชใใใใใใชใใงใใ
+
+ใใใใ**ๅคใใฎใกใขใชใไฝฟ็จ**ใใฆใใๅ ดๅ๏ผใใจใใฐ**ๆฉๆขฐๅญฆ็ฟ**ใขใใซใชใฉ๏ผใใฉใใ ใใฎใกใขใชใๆถ่ฒปใใฆใใใใ็ขบ่ชใใ**ๅใใทใณใงๅฎ่กใใใณใณใใใฎๆฐ**ใ่ชฟๆดใใๅฟ
่ฆใใใใพใ๏ผใใใฆใใใใใฏใฉในใฟใซใใทใณใ่ฟฝๅ ใใพใ๏ผใ
+
+**ใณใณใใใใจใซ่คๆฐใฎใใญใปใน**ใๅฎ่กใใๅ ดๅ๏ผใใจใใฐๅ
ฌๅผใฎDockerใคใกใผใธใง๏ผใ่ตทๅใใใใญใปในใฎๆฐใ**ๅฉ็จๅฏ่ฝใชใกใขใชไปฅไธใซๆถ่ฒปใใชใ**ใใใซใใๅฟ
่ฆใใใใพใใ
+
+## ้ๅงๅใฎไบๅในใใใใจใณใณใใ
+
+ใณใณใใ๏ผDockerใKubernetesใชใฉ๏ผใไฝฟใฃใฆใใๅ ดๅใไธปใซ2ใคใฎใขใใญใผใใใใใพใใ
+
+### ่คๆฐใฎใณใณใใ
+
+่คๆฐใฎ**ใณใณใใ**ใใใใใใใใใใใใใ**ๅไธใฎใใญใปใน**ใๅฎ่กใใฆใใๅ ดๅ๏ผ**Kubernetes**ใฏใฉในใฟใชใฉ๏ผใใฌใใชใฑใผใใใใใฏใผใซใผใณใณใใใๅฎ่กใใ**ๅใซ**ใๅไธใฎใณใณใใใง**ไบๅใฎในใใใ**ใฎไฝๆฅญใ่กใ**ๅฅใฎใณใณใใ**ใๆใกใใใจๆใใงใใใใ
+
+!!! info
+ ใใKubernetesใไฝฟ็จใใฆใใๅ ดๅ, ใใใฏใใใใInit ใณใณใใใงใใใใ
+
+ใฆใผในใฑใผในใไบๅใฎในใใใใ**ไธฆๅใง่คๆฐๅ**ๅฎ่กใใใฎใซๅ้กใใชใๅ ดๅ๏ผไพ๏ผใใผใฟใใผในใฎๆบๅใใงใใฏ๏ผใใกใคใณใใญใปในใ้ๅงใใๅใซใใใใใฎในใใใใๅใณใณใใใซๅ
ฅใใใใจใๅฏ่ฝใงใใ
+
+### ๅไธใณใณใใ
+
+ๅ็ดใชใปใใใขใใใงใ**ๅไธใฎใณใณใใ**ใง่คๆฐใฎ**ใฏใผใซใผใปใใญใปใน**๏ผใพใใฏ1ใคใฎใใญใปในใฎใฟ๏ผใ่ตทๅใใๅ ดๅใใขใใชใงใใญใปในใ้ๅงใใ็ดๅใซใๅใใณใณใใใงไบๅใฎในใใใใๅฎ่กใงใใพใใๅ
ฌๅผDockerใคใกใผใธใฏใๅ
้จ็ใซใใใใตใใผใใใฆใใพใใ
+
+## Gunicornใซใใๅ
ฌๅผDockerใคใกใผใธ - Uvicorn
+
+ๅใฎ็ซ ใง่ฉณใใ่ชฌๆใใใใใซใUvicornใฏใผใซใผใงๅไฝใใGunicornใๅซใๅ
ฌๅผใฎDockerใคใกใผใธใใใใพใ๏ผ [Server Workers - Gunicorn ใจ Uvicorn](./server-workers.md){.internal-link target=_blank}ใง่ฉณใใ่ชฌๆใใฆใใพใใ
+
+ใใฎใคใกใผใธใฏใไธปใซไธ่จใง่ชฌๆใใ็ถๆณใงๅฝนใซ็ซใคใงใใใ๏ผ [่คๆฐใฎใใญใปในใจ็นๆฎใชใฑใผในใๆใคใณใณใใ๏ผContainers with Multiple Processes and Special Cases๏ผ](#containers-with-multiple-processes-and-special-cases)
+
+* tiangolo/uvicorn-gunicorn-fastapi.
+
+!!! warning
+ ใใฎใใผในใคใกใผใธใ้กไผผใฎใคใกใผใธใฏ**ๅฟ
่ฆใชใ**ๅฏ่ฝๆงใ้ซใใฎใงใ[ไธ่จใฎ: FastAPI็จใฎDockerใคใกใผใธใใใซใใใ๏ผBuild a Docker Image for FastAPI๏ผ](#build-a-docker-image-for-fastapi)ใฎใใใซใผใญใใใคใกใผใธใใใซใใใๆนใ่ฏใใงใใใใ
+
+ใใฎใคใกใผใธใซใฏใๅฉ็จๅฏ่ฝใชCPUใณใขใซๅบใฅใใฆ**ใฏใผใซใผใปใใญใปในใฎๆฐ**ใ่จญๅฎใใ**ใชใผใใใฅใผใใณใฐ**ใกใซใใบใ ใๅซใพใใฆใใพใใ
+
+ใใใฏ**่ณขๆใชใใใฉใซใ**ใๅใใฆใใพใใใ**็ฐๅขๅคๆฐ**ใ่จญๅฎใใกใคใซใไฝฟใฃใฆใในใฆใฎ่จญๅฎใๅคๆดใใใๆดๆฐใใใใใใใจใใงใใพใใ
-## TraefikใจHTTPSใไฝฟ็จใใDocker Swarmใขใผใใฎใฏใฉในใฟ
+ใพใใในใฏใชใใใง**้ๅงๅใฎไบๅในใใใ**ใๅฎ่กใใใใจใใตใใผใใใฆใใใ
-HTTPSใๅฆ็ใใ๏ผ่จผๆๆธใฎๅๅพใจๆดๆฐใๅซใ๏ผTraefikใไฝฟ็จใใฆใDocker Swarmใขใผใใฎใฏใฉในใฟใๆฐๅ๏ผ20ๅ็จๅบฆ๏ผใงใปใใใขใใใงใใพใใ
+!!! tip
+ ใในใฆใฎ่จญๅฎใจใชใใทใงใณใ่ฆใใซใฏใDockerใคใกใผใธใฎใใผใธใใ่ฆงใใ ใใ: tiangolo/uvicorn-gunicorn-fastapi
-Docker Swarmใขใผใใไฝฟ็จใใใใจใงใ1ๅฐใฎใใทใณใฎใใฏใฉในใฟใใใ้ๅงใงใ๏ผ1ใๆใใใ5ใใซใฎใตใผใใผใงใใงใใพใ๏ผใๅพใใๅฟ
่ฆใชใ ใใตใผใใผใๆกๅผตใงใใพใใ
+### ๅ
ฌๅผDockerใคใกใผใธใฎใใญใปในๆฐ
-TraefikใใใณHTTPSๅฆ็ใๅใใDocker Swarm Modeใฏใฉในใฟใผใใปใใใขใใใใใซใฏใๆฌกใฎใฌใคใใซๅพใใพใ:
+ใใฎใคใกใผใธใฎ**ใใญใปในๆฐ**ใฏใๅฉ็จๅฏ่ฝใชCPU**ใณใข**ใใ**่ชๅ็ใซ่จ็ฎ**ใใใพใใ
+
+ใคใพใใCPUใใๅฏ่ฝใช้ใ**ใใใฉใผใใณใน**ใ**ๅผใๅบใใ**ใจใใพใใ
+
+ใพใใ**็ฐๅขๅคๆฐ**ใชใฉใไฝฟใฃใ่จญๅฎใง่ชฟๆดใใใใจใใงใใพใใ
+
+ใใใใใใญใปในใฎๆฐใฏใณใณใใใๅฎ่กใใฆใใCPUใซไพๅญใใใใใ**ๆถ่ฒปใใใใกใขใชใฎ้**ใใใใซไพๅญใใใใจใซใชใใพใใ
+
+ใใฎใใใ๏ผๆฉๆขฐๅญฆ็ฟใขใใซใชใฉใง๏ผๅคง้ใฎใกใขใชใๆถ่ฒปใใใขใใชใฑใผใทใงใณใงใใตใผใใผใฎCPUใณใขใๅคใใ**ใกใขใชใๅฐใชใ**ๅ ดๅใใณใณใใใฏๅฉ็จๅฏ่ฝใชใกใขใชใใใๅคใใฎใกใขใชใไฝฟใใใจใใใใจใซใชใใพใใ
+
+ใใฎ็ตๆใใใใฉใผใใณในใๅคงๅน
ใซไฝไธใใ๏ผใใใใฏใฏใฉใใทใฅใใ๏ผๅฏ่ฝๆงใใใใพใใ๐จ
+
+### Dockerfileใไฝๆใใ
+
+ใใฎ็ปๅใซๅบใฅใใฆ`Dockerfile`ใไฝๆใใๆนๆณใไปฅไธใซ็คบใใพใ๏ผ
+
+```Dockerfile
+FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
+
+COPY ./requirements.txt /app/requirements.txt
+
+RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
+
+COPY ./app /app
+```
+
+### ใใๅคงใใชใขใใชใฑใผใทใงใณ
+
+[่คๆฐใฎใใกใคใซใๆใคๅคงใใชใขใใชใฑใผใทใงใณ](../tutorial/bigger-applications.md){.internal-link target=_blank}ใไฝๆใใใปใฏใทใงใณใซๅพใฃใๅ ดๅใ`Dockerfile`ใฏๆฌกใฎใใใซใชใใพใ๏ผ
+
+```Dockerfile hl_lines="7"
+FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
+
+COPY ./requirements.txt /app/requirements.txt
+
+RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
+
+COPY ./app /app/app
+```
+
+### ใใคไฝฟใใฎใ
+
+ใใใใใ**Kubernetes**๏ผใพใใฏไปใฎใใฎ๏ผใไฝฟ็จใใฆใใฆใใใงใซใฏใฉในใฟใฌใใซใง่คๆฐใฎ**ใณใณใใ**ใง**ใฌใใชใฑใผใทใงใณ**ใ่จญๅฎใใฆใใๅ ดๅใฏใใใฎๅ
ฌๅผใใผในใคใกใผใธ๏ผใพใใฏไปใฎ้กไผผใฎใใฎ๏ผใฏ**ไฝฟ็จใในใใงใฏใใใพใใ**ใ
+
+ใใฎใใใชๅ ดๅใฏใไธ่จใฎใใใซ**ใผใญใใ**ใคใกใผใธใๆง็ฏใใๆนใใใใงใใใ๏ผ [FastAPI็จใฎDockerใคใกใผใธใใใซใใใ๏ผBuild a Docker Image for FastAPI๏ผ](#build-a-docker-image-for-fastapi) ใๅ็
งใใฆใใ ใใใ
+
+ใใฎใคใกใผใธใฏใไธปใซไธ่จใฎ[่คๆฐใฎใใญใปในใจ็นๆฎใชใฑใผในใๆใคใณใณใใ๏ผContainers with Multiple Processes and Special Cases๏ผ](#containers-with-multiple-processes-and-special-cases)ใง่ชฌๆใใใใใช็นๆฎใชใฑใผในใงๅฝนใซ็ซใกใพใใ
+
+ไพใใฐใใขใใชใฑใผใทใงใณใ**ใทใณใใซ**ใงใCPUใซๅฟใใใใใฉใซใใฎใใญใปในๆฐใ่จญๅฎใใใฐใใพใใใๅ ดๅใใใฏใฉในใฟใฌใใซใงใฌใใชใฑใผใทใงใณใๆๅใง่จญๅฎใใๆ้ใ็ใใใๅ ดๅใใขใใชใง่คๆฐใฎใณใณใใใๅฎ่กใใชใๅ ดๅใชใฉใงใใ
+
+ใพใใฏใ**Docker Compose**ใงใใใญใคใใๅไธใฎใตใผใใงๅฎ่กใใฆใใๅ ดๅใชใฉใงใใ
+
+## ใณใณใใใปใคใกใผใธใฎใใใญใค
+
+ใณใณใใ๏ผDocker๏ผใคใกใผใธใๆใซๅ
ฅใใๅพใใใใใใใญใคใใใซใฏใใใคใใฎๆนๆณใใใใพใใ
+
+ไพใใฐไปฅไธใฎใชในใใฎๆนๆณใงใ:
+
+* ๅไธใตใผใใผใฎ**Docker Compose**
+* **Kubernetes**ใฏใฉในใฟ
+* Docker Swarmใขใผใใฎใฏใฉในใฟใผ
+* Nomadใฎใใใชๅฅใฎใใผใซ
+* ใณใณใใใปใคใกใผใธใใใใญใคใใใฏใฉใฆใใปใตใผใใน
+
+## Poetryใๅฉ็จใใDockerใคใกใผใธ
+
+ใใใใญใธใงใฏใใฎไพๅญ้ขไฟใ็ฎก็ใใใใใซPoetryใๅฉ็จใใๅ ดๅใใใซใในใใผใธใใซใใไฝฟใใจ่ฏใใงใใใใ
+
+```{ .dockerfile .annotate }
+# (1)
+FROM python:3.9 as requirements-stage
+
+# (2)
+WORKDIR /tmp
+
+# (3)
+RUN pip install poetry
+
+# (4)
+COPY ./pyproject.toml ./poetry.lock* /tmp/
+
+# (5)
+RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
+
+# (6)
+FROM python:3.9
+
+# (7)
+WORKDIR /code
+
+# (8)
+COPY --from=requirements-stage /tmp/requirements.txt /code/requirements.txt
+
+# (9)
+RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
+
+# (10)
+COPY ./app /code/app
+
+# (11)
+CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
+```
+
+1. ใใใฏๆๅใฎในใใผใธใงใ`requirements-stage`ใจๅไปใใใใพใ
+2. `/tmp` ใ็พๅจใฎไฝๆฅญใใฃใฌใฏใใชใซ่จญๅฎใใพใ
+ ใใใง `requirements.txt` ใจใใใใกใคใซใ็ๆใใพใใ
+
+3. ใใฎDockerในใใผใธใซPoetryใใคใณในใใผใซใใพใ
+
+4. pyproject.toml`ใจ`poetry.lock`ใใกใคใซใ`/tmp` ใใฃใฌใฏใใชใซใณใใผใใพใ
+
+ `./poetry.lock*`๏ผๆซๅฐพใซ`*`๏ผใไฝฟ็จใใใใใใใฎใใกใคใซใใพใ ๅฉ็จใงใใชใๅ ดๅใงใใฏใฉใใทใฅใใใใจใฏใชใใงใใ
+5. requirements.txt`ใใกใคใซใ็ๆใใพใ
+
+6. ใใใฏๆๅพใฎในใใผใธใงใใใใใใซใใใใฎใฏใในใฆๆ็ต็ใชใณใณใใใปใคใกใผใธใซไฟๅญใใใพใ
+7. ็พๅจใฎไฝๆฅญใใฃใฌใฏใใชใ `/code` ใซ่จญๅฎใใพใ
+8. `requirements.txt`ใใกใคใซใ `/code` ใใฃใฌใฏใใชใซใณใใผใใพใ
+ ใใฎใใกใคใซใฏๅใฎDockerในใใผใธใซใใๅญๅจใใชใใใใ`--from-requirements-stage`ใไฝฟใฃใฆใณใใผใใพใใ
+9. ็ๆใใใ `requirements.txt` ใใกใคใซใซใใใใใฑใผใธใฎไพๅญ้ขไฟใใคใณในใใผใซใใพใ
+10. app` ใใฃใฌใฏใใชใ `/code` ใใฃใฌใฏใใชใซใณใใผใใพใ
+11. uvicorn` ใณใใณใใๅฎ่กใใฆใ`app.main` ใใใคใณใใผใใใ `app` ใชใใธใงใฏใใไฝฟ็จใใใใใซๆ็คบใใพใ
+!!! tip
+ "+"ใฎๅนใๅบใใใฏใชใใฏใใใจใใใใใใฎ่กใไฝใใใใฎใใ่ฆใใใจใใงใใพใ
+
+**Dockerในใใผใธ**ใฏ`Dockerfile`ใฎไธ้จใงใ**ไธๆ็ใชใณใณใใใคใกใผใธ**ใจใใฆๅไฝใใพใใ
+
+ๆๅใฎในใใผใธใฏ **Poetryใฎใคใณในใใผใซ**ใจ Poetry ใฎ `pyproject.toml` ใใกใคใซใใใใญใธใงใฏใใฎไพๅญ้ขไฟใๅซใ**`requirements.txt`ใ็ๆ**ใใใใใ ใใซไฝฟ็จใใใพใใ
+
+ใใฎ `requirements.txt` ใใกใคใซใฏๅพๅใฎ **ๆฌกใฎในใใผใธ**ใง `pip` ใจๅ
ฑใซไฝฟ็จใใใพใใ
+
+ๆ็ต็ใชใณใณใใใคใกใผใธใงใฏใ**ๆ็ตในใใผใธ**ใฎใฟใไฟๅญใใใพใใๅใฎในใใผใธใฏ็ ดๆฃใใใพใใ
+
+Poetryใไฝฟ็จใใๅ ดๅใ**Dockerใใซใในใใผใธใใซใ**ใไฝฟ็จใใใใจใฏ็ใซใใชใฃใฆใใพใใ
+
+ใชใใชใใๆ็ต็ใชใณใณใใใคใกใผใธใซPoetryใจใใฎไพๅญ้ขไฟใใคใณในใใผใซใใใฆใใๅฟ
่ฆใฏใชใใ**ๅฟ
่ฆใชใฎใฏ**ใใญใธใงใฏใใฎไพๅญ้ขไฟใใคใณในใใผใซใใใใใซ็ๆใใใ `requirements.txt` ใใกใคใซใ ใใ ใใใงใใ
+
+ใใใฆๆฌกใฎ๏ผใใใฆๆ็ต็ใช๏ผในใใผใธใงใฏใๅ่ฟฐใจใปใผๅใๆนๆณใงใคใกใผใธใใใซใใใพใใ
+
+### TLS Termination Proxyใฎ่ฃๅด - Poetry
+
+็นฐใ่ฟใใซใชใใพใใใNginxใTraefikใฎใใใชTLS Termination Proxy๏ผใญใผใใใฉใณใตใผ๏ผใฎๅพใใงใณใณใใใๅใใใฆใใๅ ดๅใฏใ`--proxy-headers`ใชใใทใงใณใใณใใณใใซ่ฟฝๅ ใใพใ๏ผ
+
+```Dockerfile
+CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]
+```
-### Docker Swarm Mode and Traefik for an HTTPS cluster
+## ใพใจใ
-### FastAPIใขใใชใฑใผใทใงใณใฎใใใญใค
+ใณใณใใใปใทในใใ ๏ผไพใใฐ**Docker**ใ**Kubernetes**ใชใฉ๏ผใไฝฟใใฐใใในใฆใฎ**ใใใญใคใกใณใใฎใณใณใปใใ**ใๆฑใใฎใใใชใ็ฐกๅใซใชใใพใ๏ผ
-ใในใฆใ่จญๅฎใใใใใฎๆใ็ฐกๅใชๆนๆณใฏใ[**FastAPI** Project Generators](../project-generation.md){.internal-link target=_blank}ใไฝฟ็จใใใใจใงใใใใ
+* ใปใญใฅใชใใฃ - HTTPS
+* ่ตทๅๆใฎๅฎ่ก
+* ๅ่ตทๅ
+* **ใฌใใชใฑใผใทใงใณ๏ผๅฎ่กไธญใฎใใญใปในๆฐ๏ผ**
+* ใกใขใช
+* ้ๅงๅใฎไบๅในใใใ
-ไธ่ฟฐใใTraefikใจHTTPSใๅใใDocker Swarm ใฏใฉในใฟใ็ตฑๅใใใใใใซ่จญ่จใใใฆใใพใใ
+ใปใจใใฉใฎๅ ดๅใใใผในใจใชใใคใกใผใธใฏไฝฟ็จใใใๅ
ฌๅผใฎPython Dockerใคใกใผใธใใใผในใซใใ**ใณใณใใใคใกใผใธใใผใญใใใใซใ**ใใพใใ
-2ๅ็จๅบฆใงใใญใธใงใฏใใ็ๆใใใพใใ
+`Dockerfile`ใจ**Dockerใญใฃใใทใฅ**ๅ
ใฎๅฝไปคใฎ**้ ็ช**ใซๆณจๆใใใใจใงใ**ใใซใๆ้ใๆๅฐๅ**ใใใใจใใงใใ็็ฃๆงใๆๅคงๅใใใใจใใงใใพใ๏ผใใใฆ้ๅฑใ้ฟใใใใจใใงใใพใ๏ผใ๐
-็ๆใใใใใญใธใงใฏใใฏใใใญใคใฎๆ็คบใใใใพใใใใใใๅฎ่กใใใจใใใซ2ๅใใใใพใใ
+็นๅฅใชใฑใผในใงใฏใFastAPI็จใฎๅ
ฌๅผDockerใคใกใผใธใไฝฟใใใใใใใใพใใใ๐ค
diff --git a/docs/ja/docs/deployment/server-workers.md b/docs/ja/docs/deployment/server-workers.md
new file mode 100644
index 000000000..e1ea165a2
--- /dev/null
+++ b/docs/ja/docs/deployment/server-workers.md
@@ -0,0 +1,182 @@
+# Server Workers - Gunicorn ใจ Uvicorn
+
+ๅๅใฎใใใญใคใกใณใใฎใณใณใปใใใๆฏใ่ฟใฃใฆใฟใพใใใ๏ผ
+
+* ใปใญใฅใชใใฃ - HTTPS
+* ่ตทๅๆใฎๅฎ่ก
+* ๅ่ตทๅ
+* **ใฌใใชใฑใผใทใงใณ๏ผๅฎ่กไธญใฎใใญใปในๆฐ๏ผ**
+* ใกใขใช
+* ้ๅงๅใฎไบๅในใใใ
+
+ใใใพใงใฎใใญใฅใกใณใใฎใใฅใผใใชใขใซใงใฏใใใใใUvicornใฎใใใช**ใตใผใใผใใญใฐใฉใ **ใ**ๅไธใฎใใญใปใน**ใงๅฎ่กใใฆใใพใใ
+
+ใขใใชใฑใผใทใงใณใใใใญใคใใ้ใซใฏใ**่คๆฐใฎใณใข**ใๅฉ็จใใใใใฆใใๅคใใฎใชใฏใจในใใๅฆ็ใงใใใใใซใใใใใซใใใญใปในใฎ**ใฌใใชใฑใผใทใงใณ**ใๆใคใใจใๆใใงใใใใ
+
+ๅใฎใใฃใใฟใผใงใใ[ใใใญใคใกใณใใฎใณใณใปใใ](./concepts.md){.internal-link target=_blank}ใซใฆ่ฆใฆใใใใใซใๆๅนใชๆฆ็ฅใใใใคใใใใพใใ
+
+ใใใงใฏ**Gunicorn**ใ**Uvicornใฎใฏใผใซใผใปใใญใปใน**ใ็ฎก็ใใๅ ดๅใฎไฝฟใๆนใซใคใใฆ็ดนไปใใฆใใใพใใ
+
+!!! info
+
+ DockerใKubernetesใชใฉใฎใณใณใใใไฝฟ็จใใฆใใๅ ดๅใฏใๆฌกใฎ็ซ ใง่ฉณใใ่ชฌๆใใพใ๏ผ [ใณใณใใๅ
ใฎFastAPI - Docker](./docker.md){.internal-link target=_blank}
+
+ ็นใซ**Kubernetes**ไธใงๅฎ่กใใๅ ดๅใฏใใใใใ**Gunicornใไฝฟ็จใใ**ใ**ใณใณใใใใจใซๅไธใฎUvicornใใญใปใน**ใๅฎ่กใใใใจใซใชใใพใใใใใใซใคใใฆใฏใใฎ็ซ ใฎๅพๅใง่ชฌๆใใพใใ
+
+## GunicornใซใใUvicornใฎใฏใผใซใผใปใใญใปในใฎ็ฎก็
+
+**Gunicorn**ใฏ**WSGIๆจๆบ**ใฎใขใใชใฑใผใทใงใณใตใผใใผใงใใใใฎใใจใฏใGunicornใฏFlaskใDjangoใฎใใใชใขใใชใฑใผใทใงใณใซใตใผใในใๆไพใงใใใใจใๆๅณใใพใใGunicornใใ่ชไฝใฏ**FastAPI**ใจไบๆๆงใใชใใงใใใใจใใใฎใFastAPIใฏๆๆฐใฎ**ASGI ๆจๆบ**ใไฝฟ็จใใฆใใใใใงใใ
+
+ใใใใGunicornใฏ**ใใญใปในใใใผใธใฃใผ**ใจใใฆๅไฝใใใฆใผใถใผใ็นๅฎใฎ**ใฏใผใซใผใปใใญใปในใฏใฉใน**ใไฝฟ็จใใใใใซๆ็คบใใใใจใใงใใพใใใใใจGunicornใฏใใฎใฏใฉในใไฝฟใ1ใคไปฅไธใฎ**ใฏใผใซใผใปใใญใปใน**ใ้ๅงใใพใใ
+
+ใใใฆ**Uvicorn**ใซใฏ**Gunicornไบๆใฎใฏใผใซใผใฏใฉใน**ใใใใพใใ
+
+ใใฎ็ตใฟๅใใใงใGunicornใฏ**ใใญใปในใใใผใธใฃใผ**ใจใใฆๅไฝใใ**ใใผใ**ใจ**IP**ใใชใในใณใใพใใใใใฆใ**Uvicornใฏใฉใน**ใๅฎ่กใใฆใใใฏใผใซใผใปใใญใปในใซ้ไฟกใ**่ปข้**ใใพใใ
+
+ใใใฆใGunicornไบๆใฎ**Uvicornใฏใผใซใผ**ใฏใฉในใใFastAPIใไฝฟใใใใใซใGunicornใใ้ใใใฆใใใใผใฟใASGIๆจๆบใซๅคๆใใๅฝนๅฒใๆ
ใใพใใ
+
+## GunicornใจUvicornใใคใณในใใผใซใใ
+
+
+
+```console
+$ pip install "uvicorn[standard]" gunicorn
+
+---> 100%
+```
+
+
+
+ใใใซใใUvicornใจ๏ผ้ซๆง่ฝใๅพใใใใฎ๏ผๆจๆบ๏ผ`standard`๏ผใฎ่ฟฝๅ ใใใฑใผใธใจGunicornใฎไธกๆนใใคใณในใใผใซใใใพใใ
+
+## UvicornใฎใฏใผใซใผใจใจใใซGunicornใๅฎ่กใใ
+
+Gunicornใไปฅไธใฎใใใซ่ตทๅใใใใใจใใงใใพใ:
+
+
+
+```console
+$ gunicorn main:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:80
+
+[19499] [INFO] Starting gunicorn 20.1.0
+[19499] [INFO] Listening at: http://0.0.0.0:80 (19499)
+[19499] [INFO] Using worker: uvicorn.workers.UvicornWorker
+[19511] [INFO] Booting worker with pid: 19511
+[19513] [INFO] Booting worker with pid: 19513
+[19514] [INFO] Booting worker with pid: 19514
+[19515] [INFO] Booting worker with pid: 19515
+[19511] [INFO] Started server process [19511]
+[19511] [INFO] Waiting for application startup.
+[19511] [INFO] Application startup complete.
+[19513] [INFO] Started server process [19513]
+[19513] [INFO] Waiting for application startup.
+[19513] [INFO] Application startup complete.
+[19514] [INFO] Started server process [19514]
+[19514] [INFO] Waiting for application startup.
+[19514] [INFO] Application startup complete.
+[19515] [INFO] Started server process [19515]
+[19515] [INFO] Waiting for application startup.
+[19515] [INFO] Application startup complete.
+```
+
+
+
+ใใใใใฎใชใใทใงใณใฎๆๅณใ่ฆใฆใฟใพใใใ๏ผ
+
+* `main:app`๏ผ `main`ใฏ"`main`"ใจใใๅๅใฎPythonใขใธใฅใผใซใใคใพใใใกใคใซ`main.py`ใๆๅณใใพใใใใใฆ `app` ใฏ **FastAPI** ใขใใชใฑใผใทใงใณใฎๅคๆฐๅใงใใ
+ * main:app`ใฏPythonใฎ`import`ๆใจๅใใใใชใใฎใ ใจๆณๅใงใใพใ๏ผ
+
+ ```Python
+ from main import app
+ ```
+
+ * ใคใพใใ`main:app`ใฎใณใญใณใฏใ`from main import app`ใฎPythonใฎ`import`ใฎ้จๅใจๅใใซใชใใพใใ
+
+* `--workers`๏ผ ไฝฟ็จใใใฏใผใซใผใปใใญใปในใฎๆฐใงใใใใใใUvicornใฎใฏใผใซใผใๅฎ่กใใพใใ
+
+* `--worker-class`๏ผ ใฏใผใซใผใปใใญใปในใงไฝฟ็จใใGunicornไบๆใฎใฏใผใซใผใฏใฉในใงใใ
+ * ใใใงใฏGunicornใใคใณใใผใใใฆไฝฟ็จใงใใใฏใฉในใๆธกใใพใ๏ผ
+
+ ```Python
+ import uvicorn.workers.UvicornWorker
+ ```
+
+* `--bind`๏ผ GunicornใซใชใในใณใใIPใจใใผใใไผใใพใใใณใญใณ(`:`)ใงIPใจใใผใใๅบๅใใพใใ
+ * Uvicornใ็ดๆฅๅฎ่กใใฆใใๅ ดๅใฏใ`--bind 0.0.0.0:80` ๏ผGunicornใฎใชใใทใงใณ๏ผใฎไปฃใใใซใ`--host 0.0.0.0`ใจ `--port 80`ใไฝฟใใพใใ
+
+ๅบๅใงใฏใๅใใญใปในใฎ**PID**๏ผใใญใปในID๏ผใ่กจ็คบใใใฆใใใฎใใใใใพใ๏ผๅใชใๆฐๅญใงใ๏ผใ
+
+ไปฅไธใฎ้ใใงใ๏ผ
+
+* Gunicornใฎ**ใใญใปในใปใใใผใธใฃใผ**ใฏPID `19499`๏ผใใชใใฎๅ ดๅใฏ้ใ็ชๅทใงใใใ๏ผใงๅงใพใใพใใ
+* ๆฌกใซใ`Listening at: http://0.0.0.0:80`ใ้ๅงใใพใใ
+* ใใใใ `uvicorn.workers.UvicornWorker` ใงใฏใผใซใผใฏใฉในใไฝฟ็จใใใใจใๆคๅบใใพใใ
+* ใใใฆใ**4ใคใฎใฏใผใซใผ**ใ่ตทๅใใพใใใใใใใฎใฏใผใซใผใฎPIDใฏใ`19511`ใ`19513`ใ`19514`ใ`19515`ใงใใ
+
+Gunicornใฏใพใใใฏใผใซใผใฎๆฐใ็ถญๆใใใใใซๅฟ
่ฆใงใใใฐใ**ใใฆใณใใใใญใปใน**ใ็ฎก็ใใ**ๆฐใใใใญใปในใ**ๅ่ตทๅ**ใใใพใใใใฎใใใไธ่จใฎใชในใใซใใ**ๅ่ตทๅ**ใฎๆฆๅฟตใซไธ้จๅฝน็ซใกใพใใ
+
+ใใใใชใใใๅฟ
่ฆใงใใใฐGunicornใ**ๅ่ตทๅ**ใใใ**่ตทๅๆใซๅฎ่ก**ใใใใชใฉใๅค้จใฎใณใณใใผใใณใใๆใใใใใจใๅฟ
่ฆใใใใใพใใใ
+
+## Uvicornใจใฏใผใซใผ
+
+Uvicornใซใฏ่คๆฐใฎ**ใฏใผใซใผใปใใญใปใน**ใ่ตทๅใๅฎ่กใใใชใใทใงใณใใใใพใใ
+
+ใจใฏใใใใฎใฎใไปใฎใจใใUvicornใฎใฏใผใซใผใปใใญใปในใๆฑใๆฉ่ฝใฏGunicornใใใๅถ้ใใใฆใใพใใใใฎใใใใใฎใฌใใซ๏ผPythonใฌใใซ๏ผใงใใญใปในใใใผใธใฃใผใๆใกใใใฎใงใใใฐใGunicornใใใญใปในใใใผใธใฃใผใจใใฆไฝฟใฃใฆใฟใๆนใ่ณขๆใใใใใชใใงใใ
+
+ใฉใใชๅ ดๅใงใใใไปฅไธใฎใใใซๅฎ่กใใพใ๏ผ
+
+
+
+```console
+$ uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
+INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
+INFO: Started parent process [27365]
+INFO: Started server process [27368]
+INFO: Waiting for application startup.
+INFO: Application startup complete.
+INFO: Started server process [27369]
+INFO: Waiting for application startup.
+INFO: Application startup complete.
+INFO: Started server process [27370]
+INFO: Waiting for application startup.
+INFO: Application startup complete.
+INFO: Started server process [27367]
+INFO: Waiting for application startup.
+INFO: Application startup complete.
+```
+
+
+
+ใใใงๅฏไธใฎๆฐใใใชใใทใงใณใฏ `--workers` ใงใUvicornใซ4ใคใฎใฏใผใซใผใปใใญใปในใ่ตทๅใใใใใซๆ็คบใใฆใใพใใ
+
+ๅใใญใปในใฎ **PID** ใ่กจ็คบใใใ่ฆชใใญใปในใฎ `27365` (ใใใฏ **ใใญใปในใใใผใธใฃ**) ใจใๅใฏใผใซใผใปใใญใปในใฎ **PID** ใ่กจ็คบใใใพใ๏ผ `27368`ใ`27369`ใ`27370`ใ`27367`ใซใชใใพใใ
+
+## ใใใญใคใกใณใใฎใณใณใปใใ
+
+ใใใงใฏใใขใใชใฑใผใทใงใณใฎๅฎ่กใ**ไธฆๅๅ**ใใCPUใฎ**ใใซใใณใข**ใๆดป็จใใ**ใใๅคใใฎใชใฏใจในใ**ใซๅฏพๅฟใงใใใใใซใใใใใซใ**Gunicorn**๏ผใพใใฏUvicorn๏ผใไฝฟ็จใใฆ**Uvicornใฏใผใซใผใปใใญใปใน**ใ็ฎก็ใใๆนๆณใ่ฆใฆใใใพใใใ
+
+ไธ่จใฎใใใญใคใฎใณใณใปใใใฎใชในใใใใใฏใผใซใผใไฝฟใใใจใฏไธปใซ**ใฌใใชใฑใผใทใงใณ**ใฎ้จๅใจใ**ๅ่ตทๅ**ใๅฐใๅฉใใฆใใใพใ๏ผ
+
+* ใปใญใฅใชใใฃ - HTTPS
+* ่ตทๅๆใฎๅฎ่ก
+* ๅ่ตทๅ
+* ใฌใใชใฑใผใทใงใณ๏ผๅฎ่กไธญใฎใใญใปในๆฐ๏ผ
+* ใกใขใชใผ
+* ้ๅงๅใฎไบๅใฎในใใใ
+
+
+## ใณใณใใใจDocker
+
+ๆฌก็ซ ใฎ[ใณใณใใๅ
ใฎFastAPI - Docker](./docker.md){.internal-link target=_blank}ใงใฏใใใฎไปใฎ**ใใใญใคใฎใณใณใปใใ**ใๆฑใใใใซๅฎๆฝใใใงใใใๆฆ็ฅใใใใคใ็ดนไปใใพใใ
+
+ใพใใ**GunicornใจUvicornใฏใผใซใผ**ใๅซใ**ๅ
ฌๅผDockerใคใกใผใธ**ใจใ็ฐกๅใชใฑใผในใซๅฝน็ซใคใใใคใใฎใใใฉใซใ่จญๅฎใ็ดนไปใใพใใ
+
+ใพใใ(Gunicornใไฝฟใใใซ)Uvicornใใญใปในใ1ใคใ ใๅฎ่กใใใใใซใ**ใผใญใใ็ฌ่ชใฎใคใกใผใธใ**ๆง็ฏใใๆนๆณใ็ดนไปใใพใใใใใฏ็ฐกๅใชใใญใปในใงใใใใใ**Kubernetes**ใฎใใใชๅๆฃใณใณใใ็ฎก็ใทในใใ ใไฝฟใใจใใซใใใใใใจใงใใใใ
+
+## ใพใจใ
+
+Uvicornใฏใผใซใผใไฝฟใฃใใใญใปในใใใผใธใฃใจใใฆ**Gunicorn**๏ผใพใใฏUvicorn๏ผใไฝฟใใฐใ**ใใซใใณใขCPU**ใๆดป็จใใฆ**่คๆฐใฎใใญใปในใไธฆๅๅฎ่ก**ใงใใพใใ
+
+ใใใใฎใใผใซใใขใคใใขใฏใ**ใใชใ่ช่บซใฎใใใญใคใทในใใ **ใใปใใใขใใใใชใใใไปใฎใใใญใคใณใณใปใใใ่ชๅใง่กใๅ ดๅใซใไฝฟใใพใใ
+
+ๆฌกใฎ็ซ ใงใฏใใณใณใใ๏ผDockerใKubernetesใชใฉ๏ผใไฝฟใฃใ**FastAPI**ใซใคใใฆๅญฆใใงใใใพใใใใใใใใฎใใผใซใซใฏใไปใฎ**ใใใญใคใฎใณใณใปใใ**ใ่งฃๆฑบใใ็ฐกๅใชๆนๆณใใใใใจใใใใใงใใใใโจ
diff --git a/docs/ja/docs/advanced/conditional-openapi.md b/docs/ja/docs/how-to/conditional-openapi.md
similarity index 100%
rename from docs/ja/docs/advanced/conditional-openapi.md
rename to docs/ja/docs/how-to/conditional-openapi.md
diff --git a/docs/pt/docs/deployment/deta.md b/docs/pt/docs/deployment/deta.md
deleted file mode 100644
index 9271bba42..000000000
--- a/docs/pt/docs/deployment/deta.md
+++ /dev/null
@@ -1,258 +0,0 @@
-# Implantaรงรฃo FastAPI na Deta
-
-Nessa seรงรฃo vocรช aprenderรก sobre como realizar a implantaรงรฃo de uma aplicaรงรฃo **FastAPI** na Deta utilizando o plano gratuito. ๐
-
-Isso tudo levarรก aproximadamente **10 minutos**.
-
-!!! info "Informaรงรฃo"
- Deta รฉ uma patrocinadora do **FastAPI**. ๐
-
-## Uma aplicaรงรฃo **FastAPI** simples
-
-* Crie e entre em um diretรณrio para a sua aplicaรงรฃo, por exemplo, `./fastapideta/`.
-
-### Cรณdigo FastAPI
-
-* Crie o arquivo `main.py` com:
-
-```Python
-from fastapi import FastAPI
-
-app = FastAPI()
-
-
-@app.get("/")
-def read_root():
- return {"Hello": "World"}
-
-
-@app.get("/items/{item_id}")
-def read_item(item_id: int):
- return {"item_id": item_id}
-```
-
-### Requisitos
-
-Agora, no mesmo diretรณrio crie o arquivo `requirements.txt` com:
-
-```text
-fastapi
-```
-
-!!! tip "Dica"
- Vocรช nรฃo precisa instalar Uvicorn para realizar a implantaรงรฃo na Deta, embora provavelmente queira instalรก-lo para testar seu aplicativo localmente.
-
-### Estrutura de diretรณrio
-
-Agora vocรช terรก o diretรณrio `./fastapideta/` com dois arquivos:
-
-```
-.
-โโโ main.py
-โโโ requirements.txt
-```
-
-## Crie uma conta gratuita na Deta
-
-Agora crie uma conta gratuita na Deta, vocรช precisarรก apenas de um email e senha.
-
-Vocรช nem precisa de um cartรฃo de crรฉdito.
-
-## Instale a CLI
-
-Depois de ter sua conta criada, instale Deta CLI:
-
-=== "Linux, macOS"
-
-
-
- ```console
- $ curl -fsSL https://get.deta.dev/cli.sh | sh
- ```
-
-
-
-=== "Windows PowerShell"
-
-
-
- ```console
- $ iwr https://get.deta.dev/cli.ps1 -useb | iex
- ```
-
-
-
-Apรณs a instalaรงรฃo, abra um novo terminal para que a CLI seja detectada.
-
-Em um novo terminal, confirme se foi instalado corretamente com:
-
-
-
-```console
-$ deta --help
-
-Deta command line interface for managing deta micros.
-Complete documentation available at https://docs.deta.sh
-
-Usage:
- deta [flags]
- deta [command]
-
-Available Commands:
- auth Change auth settings for a deta micro
-
-...
-```
-
-
-
-!!! tip "Dica"
- Se vocรช tiver problemas ao instalar a CLI, verifique a documentaรงรฃo oficial da Deta.
-
-## Login pela CLI
-
-Agora faรงa login na Deta pela CLI com:
-
-
-
-```console
-$ deta login
-
-Please, log in from the web page. Waiting..
-Logged in successfully.
-```
-
-
-
-Isso abrirรก um navegador da Web e autenticarรก automaticamente.
-
-## Implantaรงรฃo com Deta
-
-Em seguida, implante seu aplicativo com a Deta CLI:
-
-
-
-```console
-$ deta new
-
-Successfully created a new micro
-
-// Notice the "endpoint" ๐
-
-{
- "name": "fastapideta",
- "runtime": "python3.7",
- "endpoint": "https://qltnci.deta.dev",
- "visor": "enabled",
- "http_auth": "enabled"
-}
-
-Adding dependencies...
-
-
----> 100%
-
-
-Successfully installed fastapi-0.61.1 pydantic-1.7.2 starlette-0.13.6
-```
-
-
-
-Vocรช verรก uma mensagem JSON semelhante a:
-
-```JSON hl_lines="4"
-{
- "name": "fastapideta",
- "runtime": "python3.7",
- "endpoint": "https://qltnci.deta.dev",
- "visor": "enabled",
- "http_auth": "enabled"
-}
-```
-
-!!! tip "Dica"
- Sua implantaรงรฃo terรก um URL `"endpoint"` diferente.
-
-## Confira
-
-Agora, abra seu navegador na URL do `endpoint`. No exemplo acima foi `https://qltnci.deta.dev`, mas o seu serรก diferente.
-
-Vocรช verรก a resposta JSON do seu aplicativo FastAPI:
-
-```JSON
-{
- "Hello": "World"
-}
-```
-
-Agora vรก para o `/docs` da sua API, no exemplo acima seria `https://qltnci.deta.dev/docs`.
-
-Ele mostrarรก sua documentaรงรฃo como:
-
-
-
-## Permitir acesso pรบblico
-
-Por padrรฃo, a Deta lidarรก com a autenticaรงรฃo usando cookies para sua conta.
-
-Mas quando estiver pronto, vocรช pode tornรก-lo pรบblico com:
-
-
-
-```console
-$ deta auth disable
-
-Successfully disabled http auth
-```
-
-
-
-Agora vocรช pode compartilhar essa URL com qualquer pessoa e elas conseguirรฃo acessar sua API. ๐
-
-## HTTPS
-
-Parabรฉns! Vocรช realizou a implantaรงรฃo do seu app FastAPI na Deta! ๐ ๐ฐ
-
-Alรฉm disso, observe que a Deta lida corretamente com HTTPS para vocรช, para que vocรช nรฃo precise cuidar disso e tenha a certeza de que seus clientes terรฃo uma conexรฃo criptografada segura. โ
๐
-
-## Verifique o Visor
-
-Na UI da sua documentaรงรฃo (vocรช estarรก em um URL como `https://qltnci.deta.dev/docs`) envie um request para *operaรงรฃo de rota* `/items/{item_id}`.
-
-Por exemplo com ID `5`.
-
-Agora vรก para https://web.deta.sh.
-
-Vocรช verรก que hรก uma seรงรฃo ร esquerda chamada "Micros" com cada um dos seus apps.
-
-Vocรช verรก uma aba com "Detalhes", e tambรฉm a aba "Visor", vรก para "Visor".
-
-Lรก vocรช pode inspecionar as solicitaรงรตes recentes enviadas ao seu aplicativo.
-
-Vocรช tambรฉm pode editรก-los e reproduzi-los novamente.
-
-
-
-## Saiba mais
-
-Em algum momento, vocรช provavelmente desejarรก armazenar alguns dados para seu aplicativo de uma forma que persista ao longo do tempo. Para isso vocรช pode usar Deta Base, que tambรฉm tem um generoso **nรญvel gratuito**.
-
-Vocรช tambรฉm pode ler mais na documentaรงรฃo da Deta.
-
-## Conceitos de implantaรงรฃo
-
-Voltando aos conceitos que discutimos em [Deployments Concepts](./concepts.md){.internal-link target=_blank}, veja como cada um deles seria tratado com a Deta:
-
-* **HTTPS**: Realizado pela Deta, eles fornecerรฃo um subdomรญnio e lidarรฃo com HTTPS automaticamente.
-* **Executando na inicializaรงรฃo**: Realizado pela Deta, como parte de seu serviรงo.
-* **Reinicializaรงรฃo**: Realizado pela Deta, como parte de seu serviรงo.
-* **Replicaรงรฃo**: Realizado pela Deta, como parte de seu serviรงo.
-* **Memรณria**: Limite predefinido pela Deta, vocรช pode contatรก-los para aumentรก-lo.
-* **Etapas anteriores a inicializaรงรฃo**: Nรฃo suportado diretamente, vocรช pode fazรช-lo funcionar com o sistema Cron ou scripts adicionais.
-
-!!! note "Nota"
- O Deta foi projetado para facilitar (e gratuitamente) a implantaรงรฃo rรกpida de aplicativos simples.
-
- Ele pode simplificar vรกrios casos de uso, mas, ao mesmo tempo, nรฃo suporta outros, como o uso de bancos de dados externos (alรฉm do prรณprio sistema de banco de dados NoSQL da Deta), mรกquinas virtuais personalizadas, etc.
-
- Vocรช pode ler mais detalhes na documentaรงรฃo da Deta para ver se รฉ a escolha certa para vocรช.
diff --git a/docs/uk/docs/fastapi-people.md b/docs/uk/docs/fastapi-people.md
new file mode 100644
index 000000000..b32f0e5ce
--- /dev/null
+++ b/docs/uk/docs/fastapi-people.md
@@ -0,0 +1,178 @@
+# ะัะดะธ FastAPI
+
+FastAPI ะผะฐั ะดะธะฒะพะฒะธะถะฝั ัะฟัะปัะฝะพัั, ัะบะฐ ะฒััะฐั ะปัะดะตะน ััะทะฝะพะณะพ ะฟะพั
ะพะดะถะตะฝะฝั.
+
+## ะขะฒะพัะตัั โ ะกัะฟัะพะฒะพะดะถัะฒะฐั
+
+ะัะธะฒัั! ๐
+
+ะฆะต ั:
+
+{% if people %}
+
+{% for user in people.maintainers %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+ะฏ - ัะฒะพัะตัั ั ััะฟัะพะฒะพะดะถัะฒะฐั **FastAPI**. ะะตัะฐะปัะฝััะต ะฟัะพ ัะต ะผะพะถะฝะฐ ะฟัะพัะธัะฐัะธ ะฒ [ะะพะฒัะดะบะฐ FastAPI - ะััะธะผะฐัะธ ะดะพะฒัะดะบั - ะะฒ'ัะทะฐัะธัั ะท ะฐะฒัะพัะพะผ](help-fastapi.md#connect-with-the-author){.internal-link target=_blank}.
+
+...ะะปะต ััั ั ั
ะพัั ะฟะพะบะฐะทะฐัะธ ะฒะฐะผ ัะฟัะปัะฝะพัั.
+
+---
+
+**FastAPI** ะพััะธะผัั ะฒะตะปะธะบั ะฟัะดััะธะผะบั ะฒัะด ัะฟัะปัะฝะพัะธ. ะ ั ั
ะพัั ะฒัะดะทะฝะฐัะธัะธ ัั
ะฝัะน ะฒะฝะตัะพะบ.
+
+ะฆะต ะปัะดะธ, ัะบั:
+
+* [ะะพะฟะพะผะฐะณะฐััั ัะฝัะธะผ ัะท ะฟัะพะฑะปะตะผะฐะผะธ (ะทะฐะฟะธัะฐะฝะฝัะผะธ) ั GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}.
+* [ะกัะฒะพััััั ะฟัะป ัะตะบะฒะตััะธ](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}.
+* ะะตัะตะณะปัะดะฐััั ะฟัะป ัะตะบะฒะตััะธ, [ะพัะพะฑะปะธะฒะพ ะฒะฐะถะปะธะฒะพ ะดะปั ะฟะตัะตะบะปะฐะดัะฒ](contributing.md#translations){.internal-link target=_blank}.
+
+ะะฟะปะตัะบะธ ัะผ. ๐ ๐
+
+## ะะฐะนะฑัะปัั ะฐะบัะธะฒะฝั ะบะพัะธัััะฒะฐัั ะผะธะฝัะปะพะณะพ ะผััััั
+
+ะฆะต ะบะพัะธัััะฒะฐัั, ัะบั [ะฝะฐะนะฑัะปััะต ะดะพะฟะพะผะฐะณะฐะปะธ ัะฝัะธะผ ัะท ะฟัะพะฑะปะตะผะฐะผะธ (ะทะฐะฟะธัะฐะฝะฝัะผะธ) ั GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} ะฟัะพััะณะพะผ ะผะธะฝัะปะพะณะพ ะผััััั. โ
+
+{% if people %}
+
+{% for user in people.last_month_active %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+## ะะบัะฟะตััะธ
+
+ะัั **ะตะบัะฟะตััะธ FastAPI**. ๐ค
+
+ะฆะต ะบะพัะธัััะฒะฐัั, ัะบั [ะฝะฐะนะฑัะปััะต ะดะพะฟะพะผะฐะณะฐะปะธ ัะฝัะธะผ ัะท ะฟัะพะฑะปะตะผะฐะผะธ (ะทะฐะฟะธัะฐะฝะฝัะผะธ) ั GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} ะฟัะพััะณะพะผ *ะฒััะพะณะพ ัะฐัั*.
+
+ะะพะฝะธ ะทะฐัะตะบะพะผะตะฝะดัะฒะฐะปะธ ัะตะฑะต ัะบ ะตะบัะฟะตััะธ, ะดะพะฟะพะผะฐะณะฐััะธ ะฑะฐะณะฐััะพะผ ัะฝัะธะผ. โจ
+
+{% if people %}
+
+{% for user in people.experts %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+## ะะฐะนะบัะฐัั ะบะพะฝััะธะฑััะพัะธ
+
+ะัั **ะะฐะนะบัะฐัั ะบะพะฝััะธะฑััะพัะธ**. ๐ท
+
+ะฆั ะบะพัะธัััะฒะฐัั [ััะฒะพัะธะปะธ ะฝะฐะนะฑัะปััั ะบัะปัะบัััั ะฟัะป ัะตะบะฒะตัััะฒ](help-fastapi.md#create-a-pull-request){.internal-link target=_blank} ัะบั ะฑัะปะธ *ะทะผะตัะถะตะฝั*.
+
+ะะพะฝะธ ะฝะฐะดะฐะปะธ ะฟัะพะณัะฐะผะฝะธะน ะบะพะด, ะดะพะบัะผะตะฝัะฐััั, ะฟะตัะตะบะปะฐะดะธ ัะพัะพ. ๐ฆ
+
+{% if people %}
+
+{% for user in people.top_contributors %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+ะ ะฑะฐะณะฐัะพ ัะฝัะธั
ะบะพะฝััะธะฑััะพััะฒ (ะฑัะปััะต ัะพัะฝั), ัั
ัััั
ะผะพะถะฝะฐ ะฟะพะฑะฐัะธัะธ ะฝะฐ ััะพััะฝัั FastAPI GitHub Contributors. ๐ท
+
+## ะะฐะนะบัะฐัั ัะตัะตะฝะทะตะฝัะธ
+
+ะฆั ะบะพัะธัััะฒะฐัั ั **ะะฐะนะบัะฐัะธะผะธ ัะตัะตะฝะทะตะฝัะฐะผะธ**. ๐ต๏ธ
+
+### ะ ะตัะตะฝะทะตะฝัะธ ะฝะฐ ะฟะตัะตะบะปะฐะดะธ
+
+ะฏ ัะพะทะผะพะฒะปัั ะปะธัะต ะบัะปัะบะพะผะฐ ะผะพะฒะฐะผะธ (ั ะฝะต ะดัะถะต ะดะพะฑัะต ๐
). ะัะถะต, ัะตัะตะฝะทะตะฝัะธ โ ัะต ัั, ั
ัะพ ะผะฐั [**ะฟะพะฒะฝะพะฒะฐะถะตะฝะฝั ัั
ะฒะฐะปัะฒะฐัะธ ะฟะตัะตะบะปะฐะดะธ**](contributing.md#translations){.internal-link target=_blank} ะดะพะบัะผะตะฝัะฐััั. ะะตะท ะฝะธั
ะฝะต ะฑัะปะพ ะฑ ะดะพะบัะผะตะฝัะฐััั ะบัะปัะบะพะผะฐ ัะฝัะธะผะธ ะผะพะฒะฐะผะธ.
+
+---
+
+**ะะฐะนะบัะฐัั ัะตัะตะฝะทะตะฝัะธ** ๐ต๏ธ ะฟะตัะตะณะปัะฝัะปะธ ะฑัะปัััััั ะฟัะป ัะตะบะฒะตัััะฒ ะฒัะด ัะฝัะธั
, ะทะฐะฑะตะทะฟะตััััะธ ัะบัััั ะบะพะดั, ะดะพะบัะผะตะฝัะฐััั ั ะพัะพะฑะปะธะฒะพ **ะฟะตัะตะบะปะฐะดัะฒ**.
+
+{% if people %}
+
+{% for user in people.top_reviewers %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+## ะกะฟะพะฝัะพัะธ
+
+ะฆะต **ะกะฟะพะฝัะพัะธ**. ๐
+
+ะะพะฝะธ ะฟัะดััะธะผัััั ะผะพั ัะพะฑะพัั ะท **FastAPI** (ัะฐ ัะฝัะธะผะธ), ะฟะตัะตะฒะฐะถะฝะพ ัะตัะตะท GitHub Sponsors.
+
+{% if sponsors %}
+
+{% if sponsors.gold %}
+
+### ะะพะปะพัั ัะฟะพะฝัะพัะธ
+
+{% for sponsor in sponsors.gold -%}
+
+{% endfor %}
+{% endif %}
+
+{% if sponsors.silver %}
+
+### ะกััะฑะฝั ัะฟะพะฝัะพัะธ
+
+{% for sponsor in sponsors.silver -%}
+
+{% endfor %}
+{% endif %}
+
+{% if sponsors.bronze %}
+
+### ะัะพะฝะทะพะฒั ัะฟะพะฝัะพัะธ
+
+{% for sponsor in sponsors.bronze -%}
+
+{% endfor %}
+{% endif %}
+
+{% endif %}
+
+### ะะฝะดะธะฒัะดัะฐะปัะฝั ัะฟะพะฝัะพัะธ
+
+{% if github_sponsors %}
+{% for group in github_sponsors.sponsors %}
+
+
+
+{% for user in group %}
+{% if user.login not in sponsors_badge.logins %}
+
+
+
+{% endif %}
+{% endfor %}
+
+
+
+{% endfor %}
+{% endif %}
+
+## ะัะพ ะดะฐะฝั - ัะตั
ะฝััะฝั ะดะตัะฐะปั
+
+ะัะฝะพะฒะฝะฐ ะผะตัะฐ ัััั ััะพััะฝะบะธ โ ะฒะธัะฒััะปะธัะธ ะทััะธะปะปั ัะฟัะปัะฝะพัะธ, ัะพะฑ ะดะพะฟะพะผะพะณัะธ ัะฝัะธะผ.
+
+ะัะพะฑะปะธะฒะพ ะฒัะฐั
ะพะฒัััะธ ะทััะธะปะปั, ัะบั ะทะฐะทะฒะธัะฐะน ะผะตะฝั ะฟะพะผััะฝั, ะฐ ะฒ ะฑะฐะณะฐััะพั
ะฒะธะฟะฐะดะบะฐั
ะฑัะปัั ะฒะฐะถะบั, ัะบ-ะพั ะดะพะฟะพะผะพะณะฐ ัะฝัะธะผ ัะท ะฟัะพะฑะปะตะผะฐะผะธ ัะฐ ะฟะตัะตะณะปัะด ะฟัะป ัะตะบะฒะตัััะฒ ะฟะตัะตะบะปะฐะดัะฒ.
+
+ะะฐะฝั ัะพะทัะฐั
ะพะฒัััััั ัะพะผััััั, ะฒะธ ะผะพะถะตัะต ะพะทะฝะฐะนะพะผะธัะธัั ะท ะฒะธั
ัะดะฝะธะผ ะบะพะดะพะผ ััั.
+
+ะขัั ั ัะฐะบะพะถ ะฟัะดะบัะตัะปัั ะฒะฝะตัะบะธ ัะฟะพะฝัะพััะฒ.
+
+ะฏ ัะฐะบะพะถ ะทะฐะปะธัะฐั ะทะฐ ัะพะฑะพั ะฟัะฐะฒะพ ะพะฝะพะฒะปัะฒะฐัะธ ะฐะปะณะพัะธัะผะธ ะฟัะดัะฐั
ัะฝะบั, ะฒะธะดะธ ัะตะนัะธะฝะณัะฒ, ะฟะพัะพะณะพะฒั ะทะฝะฐัะตะฝะฝั ัะพัะพ (ะฟัะพ ะฒััะบ ะฒะธะฟะฐะดะพะบ ๐คท).
diff --git a/docs_src/extending_openapi/tutorial003.py b/docs_src/configure_swagger_ui/tutorial001.py
similarity index 100%
rename from docs_src/extending_openapi/tutorial003.py
rename to docs_src/configure_swagger_ui/tutorial001.py
diff --git a/docs_src/extending_openapi/tutorial004.py b/docs_src/configure_swagger_ui/tutorial002.py
similarity index 100%
rename from docs_src/extending_openapi/tutorial004.py
rename to docs_src/configure_swagger_ui/tutorial002.py
diff --git a/docs_src/extending_openapi/tutorial005.py b/docs_src/configure_swagger_ui/tutorial003.py
similarity index 100%
rename from docs_src/extending_openapi/tutorial005.py
rename to docs_src/configure_swagger_ui/tutorial003.py
diff --git a/docs_src/custom_docs_ui/tutorial001.py b/docs_src/custom_docs_ui/tutorial001.py
new file mode 100644
index 000000000..f7ceb0c2f
--- /dev/null
+++ b/docs_src/custom_docs_ui/tutorial001.py
@@ -0,0 +1,38 @@
+from fastapi import FastAPI
+from fastapi.openapi.docs import (
+ get_redoc_html,
+ get_swagger_ui_html,
+ get_swagger_ui_oauth2_redirect_html,
+)
+
+app = FastAPI(docs_url=None, redoc_url=None)
+
+
+@app.get("/docs", include_in_schema=False)
+async def custom_swagger_ui_html():
+ return get_swagger_ui_html(
+ openapi_url=app.openapi_url,
+ title=app.title + " - Swagger UI",
+ oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
+ swagger_js_url="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js",
+ swagger_css_url="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css",
+ )
+
+
+@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False)
+async def swagger_ui_redirect():
+ return get_swagger_ui_oauth2_redirect_html()
+
+
+@app.get("/redoc", include_in_schema=False)
+async def redoc_html():
+ return get_redoc_html(
+ openapi_url=app.openapi_url,
+ title=app.title + " - ReDoc",
+ redoc_js_url="https://unpkg.com/redoc@next/bundles/redoc.standalone.js",
+ )
+
+
+@app.get("/users/{username}")
+async def read_user(username: str):
+ return {"message": f"Hello {username}"}
diff --git a/docs_src/extending_openapi/tutorial002.py b/docs_src/custom_docs_ui/tutorial002.py
similarity index 100%
rename from docs_src/extending_openapi/tutorial002.py
rename to docs_src/custom_docs_ui/tutorial002.py
diff --git a/fastapi/__init__.py b/fastapi/__init__.py
index c113ac1fd..d8abf2103 100644
--- a/fastapi/__init__.py
+++ b/fastapi/__init__.py
@@ -1,6 +1,6 @@
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
-__version__ = "0.101.0"
+__version__ = "0.101.1"
from starlette import status as status
diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py
index 21b47b9cb..808c86b39 100644
--- a/fastapi/exceptions.py
+++ b/fastapi/exceptions.py
@@ -48,6 +48,12 @@ class ResponseValidationError(ValidationException):
super().__init__(errors)
self.body = body
+ def __str__(self) -> str:
+ message = f"{len(self._errors)} validation errors:\n"
+ for err in self._errors:
+ message += f" {err}\n"
+ return message
+
class RouteAlreadyExistsError(FastAPIError):
def __init__(self, f_name: str):
diff --git a/requirements-docs.txt b/requirements-docs.txt
index 220d1ec3a..2e667720e 100644
--- a/requirements-docs.txt
+++ b/requirements-docs.txt
@@ -2,6 +2,7 @@
mkdocs-material==9.1.21
mdx-include >=1.4.1,<2.0.0
mkdocs-markdownextradata-plugin >=0.1.7,<0.3.0
+mkdocs-redirects>=1.2.1,<1.3.0
typer-cli >=0.0.13,<0.0.14
typer[all] >=0.6.1,<0.8.0
pyyaml >=5.3.1,<7.0.0
diff --git a/requirements-tests.txt b/requirements-tests.txt
index 0113b6f7a..6f7f4ac23 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -11,7 +11,6 @@ dirty-equals ==0.6.0
# TODO: once removing databases from tutorial, upgrade SQLAlchemy
# probably when including SQLModel
sqlalchemy >=1.3.18,<1.4.43
-peewee >=3.13.3,<4.0.0
databases[sqlite] >=0.3.2,<0.7.0
orjson >=3.2.1,<4.0.0
ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,<6.0.0
diff --git a/tests/test_multi_body_errors.py b/tests/test_multi_body_errors.py
index 931f08fc1..a51ca7253 100644
--- a/tests/test_multi_body_errors.py
+++ b/tests/test_multi_body_errors.py
@@ -51,7 +51,7 @@ def test_jsonable_encoder_requiring_error():
"loc": ["body", 0, "age"],
"msg": "Input should be greater than 0",
"input": -1.0,
- "ctx": {"gt": "0"},
+ "ctx": {"gt": 0},
"url": match_pydantic_error_url("greater_than"),
}
]
@@ -84,25 +84,12 @@ def test_put_incorrect_body_multiple():
"input": {"age": "five"},
"url": match_pydantic_error_url("missing"),
},
- {
- "ctx": {"class": "Decimal"},
- "input": "five",
- "loc": ["body", 0, "age", "is-instance[Decimal]"],
- "msg": "Input should be an instance of Decimal",
- "type": "is_instance_of",
- "url": match_pydantic_error_url("is_instance_of"),
- },
{
"type": "decimal_parsing",
- "loc": [
- "body",
- 0,
- "age",
- "function-after[to_decimal(), "
- "union[int,constrained-str,function-plain[str()]]]",
- ],
+ "loc": ["body", 0, "age"],
"msg": "Input should be a valid decimal",
"input": "five",
+ "url": match_pydantic_error_url("decimal_parsing"),
},
{
"type": "missing",
@@ -111,25 +98,12 @@ def test_put_incorrect_body_multiple():
"input": {"age": "six"},
"url": match_pydantic_error_url("missing"),
},
- {
- "ctx": {"class": "Decimal"},
- "input": "six",
- "loc": ["body", 1, "age", "is-instance[Decimal]"],
- "msg": "Input should be an instance of Decimal",
- "type": "is_instance_of",
- "url": match_pydantic_error_url("is_instance_of"),
- },
{
"type": "decimal_parsing",
- "loc": [
- "body",
- 1,
- "age",
- "function-after[to_decimal(), "
- "union[int,constrained-str,function-plain[str()]]]",
- ],
+ "loc": ["body", 1, "age"],
"msg": "Input should be a valid decimal",
"input": "six",
+ "url": match_pydantic_error_url("decimal_parsing"),
},
]
}
diff --git a/tests/test_response_model_as_return_annotation.py b/tests/test_response_model_as_return_annotation.py
index 85dd450eb..6948430a1 100644
--- a/tests/test_response_model_as_return_annotation.py
+++ b/tests/test_response_model_as_return_annotation.py
@@ -277,13 +277,15 @@ def test_response_model_no_annotation_return_exact_dict():
def test_response_model_no_annotation_return_invalid_dict():
- with pytest.raises(ResponseValidationError):
+ with pytest.raises(ResponseValidationError) as excinfo:
client.get("/response_model-no_annotation-return_invalid_dict")
+ assert "missing" in str(excinfo.value)
def test_response_model_no_annotation_return_invalid_model():
- with pytest.raises(ResponseValidationError):
+ with pytest.raises(ResponseValidationError) as excinfo:
client.get("/response_model-no_annotation-return_invalid_model")
+ assert "missing" in str(excinfo.value)
def test_response_model_no_annotation_return_dict_with_extra_data():
@@ -313,13 +315,15 @@ def test_no_response_model_annotation_return_exact_dict():
def test_no_response_model_annotation_return_invalid_dict():
- with pytest.raises(ResponseValidationError):
+ with pytest.raises(ResponseValidationError) as excinfo:
client.get("/no_response_model-annotation-return_invalid_dict")
+ assert "missing" in str(excinfo.value)
def test_no_response_model_annotation_return_invalid_model():
- with pytest.raises(ResponseValidationError):
+ with pytest.raises(ResponseValidationError) as excinfo:
client.get("/no_response_model-annotation-return_invalid_model")
+ assert "missing" in str(excinfo.value)
def test_no_response_model_annotation_return_dict_with_extra_data():
@@ -395,13 +399,15 @@ def test_response_model_model1_annotation_model2_return_exact_dict():
def test_response_model_model1_annotation_model2_return_invalid_dict():
- with pytest.raises(ResponseValidationError):
+ with pytest.raises(ResponseValidationError) as excinfo:
client.get("/response_model_model1-annotation_model2-return_invalid_dict")
+ assert "missing" in str(excinfo.value)
def test_response_model_model1_annotation_model2_return_invalid_model():
- with pytest.raises(ResponseValidationError):
+ with pytest.raises(ResponseValidationError) as excinfo:
client.get("/response_model_model1-annotation_model2-return_invalid_model")
+ assert "missing" in str(excinfo.value)
def test_response_model_model1_annotation_model2_return_dict_with_extra_data():
diff --git a/tests/test_tutorial/test_body_updates/test_tutorial001.py b/tests/test_tutorial/test_body_updates/test_tutorial001.py
index f1a46210a..58587885e 100644
--- a/tests/test_tutorial/test_body_updates/test_tutorial001.py
+++ b/tests/test_tutorial/test_body_updates/test_tutorial001.py
@@ -53,7 +53,7 @@ def test_openapi_schema(client: TestClient):
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -87,7 +87,7 @@ def test_openapi_schema(client: TestClient):
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -116,7 +116,7 @@ def test_openapi_schema(client: TestClient):
"requestBody": {
"content": {
"application/json": {
- "schema": {"$ref": "#/components/schemas/ItemInput"}
+ "schema": {"$ref": "#/components/schemas/Item-Input"}
}
},
"required": True,
@@ -126,7 +126,7 @@ def test_openapi_schema(client: TestClient):
},
"components": {
"schemas": {
- "ItemInput": {
+ "Item-Input": {
"title": "Item",
"type": "object",
"properties": {
@@ -151,7 +151,7 @@ def test_openapi_schema(client: TestClient):
},
},
},
- "ItemOutput": {
+ "Item-Output": {
"title": "Item",
"type": "object",
"required": ["name", "description", "price", "tax", "tags"],
diff --git a/tests/test_tutorial/test_body_updates/test_tutorial001_py310.py b/tests/test_tutorial/test_body_updates/test_tutorial001_py310.py
index ab696e4c8..d8a62502f 100644
--- a/tests/test_tutorial/test_body_updates/test_tutorial001_py310.py
+++ b/tests/test_tutorial/test_body_updates/test_tutorial001_py310.py
@@ -56,7 +56,7 @@ def test_openapi_schema(client: TestClient):
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -90,7 +90,7 @@ def test_openapi_schema(client: TestClient):
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -119,7 +119,7 @@ def test_openapi_schema(client: TestClient):
"requestBody": {
"content": {
"application/json": {
- "schema": {"$ref": "#/components/schemas/ItemInput"}
+ "schema": {"$ref": "#/components/schemas/Item-Input"}
}
},
"required": True,
@@ -129,7 +129,7 @@ def test_openapi_schema(client: TestClient):
},
"components": {
"schemas": {
- "ItemInput": {
+ "Item-Input": {
"title": "Item",
"type": "object",
"properties": {
@@ -154,7 +154,7 @@ def test_openapi_schema(client: TestClient):
},
},
},
- "ItemOutput": {
+ "Item-Output": {
"title": "Item",
"type": "object",
"required": ["name", "description", "price", "tax", "tags"],
diff --git a/tests/test_tutorial/test_body_updates/test_tutorial001_py39.py b/tests/test_tutorial/test_body_updates/test_tutorial001_py39.py
index 2ee6a5cb4..c604df6ec 100644
--- a/tests/test_tutorial/test_body_updates/test_tutorial001_py39.py
+++ b/tests/test_tutorial/test_body_updates/test_tutorial001_py39.py
@@ -56,7 +56,7 @@ def test_openapi_schema(client: TestClient):
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -90,7 +90,7 @@ def test_openapi_schema(client: TestClient):
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -119,7 +119,7 @@ def test_openapi_schema(client: TestClient):
"requestBody": {
"content": {
"application/json": {
- "schema": {"$ref": "#/components/schemas/ItemInput"}
+ "schema": {"$ref": "#/components/schemas/Item-Input"}
}
},
"required": True,
@@ -129,7 +129,7 @@ def test_openapi_schema(client: TestClient):
},
"components": {
"schemas": {
- "ItemInput": {
+ "Item-Input": {
"title": "Item",
"type": "object",
"properties": {
@@ -154,7 +154,7 @@ def test_openapi_schema(client: TestClient):
},
},
},
- "ItemOutput": {
+ "Item-Output": {
"title": "Item",
"type": "object",
"required": ["name", "description", "price", "tax", "tags"],
diff --git a/docs_src/sql_databases_peewee/__init__.py b/tests/test_tutorial/test_configure_swagger_ui/__init__.py
similarity index 100%
rename from docs_src/sql_databases_peewee/__init__.py
rename to tests/test_tutorial/test_configure_swagger_ui/__init__.py
diff --git a/tests/test_tutorial/test_extending_openapi/test_tutorial003.py b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py
similarity index 95%
rename from tests/test_tutorial/test_extending_openapi/test_tutorial003.py
rename to tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py
index 0184dd9f8..72db54bd2 100644
--- a/tests/test_tutorial/test_extending_openapi/test_tutorial003.py
+++ b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py
@@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
-from docs_src.extending_openapi.tutorial003 import app
+from docs_src.configure_swagger_ui.tutorial001 import app
client = TestClient(app)
diff --git a/tests/test_tutorial/test_extending_openapi/test_tutorial004.py b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py
similarity index 96%
rename from tests/test_tutorial/test_extending_openapi/test_tutorial004.py
rename to tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py
index 4f7615126..166901188 100644
--- a/tests/test_tutorial/test_extending_openapi/test_tutorial004.py
+++ b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py
@@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
-from docs_src.extending_openapi.tutorial004 import app
+from docs_src.configure_swagger_ui.tutorial002 import app
client = TestClient(app)
diff --git a/tests/test_tutorial/test_extending_openapi/test_tutorial005.py b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py
similarity index 96%
rename from tests/test_tutorial/test_extending_openapi/test_tutorial005.py
rename to tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py
index 24aeb93db..187e89ace 100644
--- a/tests/test_tutorial/test_extending_openapi/test_tutorial005.py
+++ b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py
@@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
-from docs_src.extending_openapi.tutorial005 import app
+from docs_src.configure_swagger_ui.tutorial003 import app
client = TestClient(app)
diff --git a/tests/test_tutorial/test_sql_databases_peewee/__init__.py b/tests/test_tutorial/test_custom_docs_ui/__init__.py
similarity index 100%
rename from tests/test_tutorial/test_sql_databases_peewee/__init__.py
rename to tests/test_tutorial/test_custom_docs_ui/__init__.py
diff --git a/tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py b/tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py
new file mode 100644
index 000000000..aff070d74
--- /dev/null
+++ b/tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py
@@ -0,0 +1,42 @@
+import os
+from pathlib import Path
+
+import pytest
+from fastapi.testclient import TestClient
+
+
+@pytest.fixture(scope="module")
+def client():
+ static_dir: Path = Path(os.getcwd()) / "static"
+ print(static_dir)
+ static_dir.mkdir(exist_ok=True)
+ from docs_src.custom_docs_ui.tutorial001 import app
+
+ with TestClient(app) as client:
+ yield client
+ static_dir.rmdir()
+
+
+def test_swagger_ui_html(client: TestClient):
+ response = client.get("/docs")
+ assert response.status_code == 200, response.text
+ assert "https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js" in response.text
+ assert "https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" in response.text
+
+
+def test_swagger_ui_oauth2_redirect_html(client: TestClient):
+ response = client.get("/docs/oauth2-redirect")
+ assert response.status_code == 200, response.text
+ assert "window.opener.swaggerUIRedirectOauth2" in response.text
+
+
+def test_redoc_html(client: TestClient):
+ response = client.get("/redoc")
+ assert response.status_code == 200, response.text
+ assert "https://unpkg.com/redoc@next/bundles/redoc.standalone.js" in response.text
+
+
+def test_api(client: TestClient):
+ response = client.get("/users/john")
+ assert response.status_code == 200, response.text
+ assert response.json()["message"] == "Hello john"
diff --git a/tests/test_tutorial/test_extending_openapi/test_tutorial002.py b/tests/test_tutorial/test_custom_docs_ui/test_tutorial002.py
similarity index 95%
rename from tests/test_tutorial/test_extending_openapi/test_tutorial002.py
rename to tests/test_tutorial/test_custom_docs_ui/test_tutorial002.py
index 654db2e4c..712618807 100644
--- a/tests/test_tutorial/test_extending_openapi/test_tutorial002.py
+++ b/tests/test_tutorial/test_custom_docs_ui/test_tutorial002.py
@@ -10,7 +10,7 @@ def client():
static_dir: Path = Path(os.getcwd()) / "static"
print(static_dir)
static_dir.mkdir(exist_ok=True)
- from docs_src.extending_openapi.tutorial002 import app
+ from docs_src.custom_docs_ui.tutorial002 import app
with TestClient(app) as client:
yield client
diff --git a/tests/test_tutorial/test_dataclasses/test_tutorial003.py b/tests/test_tutorial/test_dataclasses/test_tutorial003.py
index 2e5809914..f2ca85823 100644
--- a/tests/test_tutorial/test_dataclasses/test_tutorial003.py
+++ b/tests/test_tutorial/test_dataclasses/test_tutorial003.py
@@ -79,7 +79,9 @@ def test_openapi_schema():
"schema": {
"title": "Items",
"type": "array",
- "items": {"$ref": "#/components/schemas/ItemInput"},
+ "items": {
+ "$ref": "#/components/schemas/Item-Input"
+ },
}
}
},
@@ -141,7 +143,7 @@ def test_openapi_schema():
"items": {
"title": "Items",
"type": "array",
- "items": {"$ref": "#/components/schemas/ItemOutput"},
+ "items": {"$ref": "#/components/schemas/Item-Output"},
},
},
},
@@ -156,7 +158,7 @@ def test_openapi_schema():
}
},
},
- "ItemInput": {
+ "Item-Input": {
"title": "Item",
"required": ["name"],
"type": "object",
@@ -168,7 +170,7 @@ def test_openapi_schema():
},
},
},
- "ItemOutput": {
+ "Item-Output": {
"title": "Item",
"required": ["name", "description"],
"type": "object",
diff --git a/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py b/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py
index 3ffc0bca7..c5b2fb670 100644
--- a/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py
+++ b/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py
@@ -35,7 +35,7 @@ def test_openapi_schema():
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -57,7 +57,7 @@ def test_openapi_schema():
"requestBody": {
"content": {
"application/json": {
- "schema": {"$ref": "#/components/schemas/ItemInput"}
+ "schema": {"$ref": "#/components/schemas/Item-Input"}
}
},
"required": True,
@@ -67,7 +67,7 @@ def test_openapi_schema():
},
"components": {
"schemas": {
- "ItemInput": {
+ "Item-Input": {
"title": "Item",
"required": ["name", "price"],
"type": "object",
@@ -91,7 +91,7 @@ def test_openapi_schema():
},
},
},
- "ItemOutput": {
+ "Item-Output": {
"title": "Item",
"required": ["name", "description", "price", "tax", "tags"],
"type": "object",
diff --git a/tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py b/tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py
index ff98295a6..458923b5a 100644
--- a/tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py
+++ b/tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py
@@ -35,7 +35,7 @@ def test_openapi_schema():
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -57,7 +57,7 @@ def test_openapi_schema():
"requestBody": {
"content": {
"application/json": {
- "schema": {"$ref": "#/components/schemas/ItemInput"}
+ "schema": {"$ref": "#/components/schemas/Item-Input"}
}
},
"required": True,
@@ -67,7 +67,7 @@ def test_openapi_schema():
},
"components": {
"schemas": {
- "ItemInput": {
+ "Item-Input": {
"title": "Item",
"required": ["name", "price"],
"type": "object",
@@ -91,7 +91,7 @@ def test_openapi_schema():
},
},
},
- "ItemOutput": {
+ "Item-Output": {
"title": "Item",
"required": ["name", "description", "price", "tax", "tags"],
"type": "object",
diff --git a/tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py310.py b/tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py310.py
index ad1c09eae..1fcc5c4e0 100644
--- a/tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py310.py
+++ b/tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py310.py
@@ -42,7 +42,7 @@ def test_openapi_schema(client: TestClient):
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -64,7 +64,7 @@ def test_openapi_schema(client: TestClient):
"requestBody": {
"content": {
"application/json": {
- "schema": {"$ref": "#/components/schemas/ItemInput"}
+ "schema": {"$ref": "#/components/schemas/Item-Input"}
}
},
"required": True,
@@ -74,7 +74,7 @@ def test_openapi_schema(client: TestClient):
},
"components": {
"schemas": {
- "ItemInput": {
+ "Item-Input": {
"title": "Item",
"required": ["name", "price"],
"type": "object",
@@ -98,7 +98,7 @@ def test_openapi_schema(client: TestClient):
},
},
},
- "ItemOutput": {
+ "Item-Output": {
"title": "Item",
"required": ["name", "description", "price", "tax", "tags"],
"type": "object",
diff --git a/tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py39.py b/tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py39.py
index 045d1d402..470fe032b 100644
--- a/tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py39.py
+++ b/tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py39.py
@@ -42,7 +42,7 @@ def test_openapi_schema(client: TestClient):
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ItemOutput"
+ "$ref": "#/components/schemas/Item-Output"
}
}
},
@@ -64,7 +64,7 @@ def test_openapi_schema(client: TestClient):
"requestBody": {
"content": {
"application/json": {
- "schema": {"$ref": "#/components/schemas/ItemInput"}
+ "schema": {"$ref": "#/components/schemas/Item-Input"}
}
},
"required": True,
@@ -74,7 +74,7 @@ def test_openapi_schema(client: TestClient):
},
"components": {
"schemas": {
- "ItemInput": {
+ "Item-Input": {
"title": "Item",
"required": ["name", "price"],
"type": "object",
@@ -98,7 +98,7 @@ def test_openapi_schema(client: TestClient):
},
},
},
- "ItemOutput": {
+ "Item-Output": {
"title": "Item",
"required": ["name", "description", "price", "tax", "tags"],
"type": "object",
diff --git a/tests/test_tutorial/test_sql_databases_peewee/test_sql_databases_peewee.py b/tests/test_tutorial/test_sql_databases_peewee/test_sql_databases_peewee.py
deleted file mode 100644
index 4350567d1..000000000
--- a/tests/test_tutorial/test_sql_databases_peewee/test_sql_databases_peewee.py
+++ /dev/null
@@ -1,454 +0,0 @@
-import time
-from pathlib import Path
-from unittest.mock import MagicMock
-
-import pytest
-from fastapi.testclient import TestClient
-
-from ...utils import needs_pydanticv1
-
-
-@pytest.fixture(scope="module")
-def client():
- # Import while creating the client to create the DB after starting the test session
- from docs_src.sql_databases_peewee.sql_app.main import app
-
- test_db = Path("./test.db")
- with TestClient(app) as c:
- yield c
- test_db.unlink()
-
-
-@needs_pydanticv1
-def test_create_user(client):
- test_user = {"email": "johndoe@example.com", "password": "secret"}
- response = client.post("/users/", json=test_user)
- assert response.status_code == 200, response.text
- data = response.json()
- assert test_user["email"] == data["email"]
- assert "id" in data
- response = client.post("/users/", json=test_user)
- assert response.status_code == 400, response.text
-
-
-@needs_pydanticv1
-def test_get_user(client):
- response = client.get("/users/1")
- assert response.status_code == 200, response.text
- data = response.json()
- assert "email" in data
- assert "id" in data
-
-
-@needs_pydanticv1
-def test_inexistent_user(client):
- response = client.get("/users/999")
- assert response.status_code == 404, response.text
-
-
-@needs_pydanticv1
-def test_get_users(client):
- response = client.get("/users/")
- assert response.status_code == 200, response.text
- data = response.json()
- assert "email" in data[0]
- assert "id" in data[0]
-
-
-time.sleep = MagicMock()
-
-
-@needs_pydanticv1
-def test_get_slowusers(client):
- response = client.get("/slowusers/")
- assert response.status_code == 200, response.text
- data = response.json()
- assert "email" in data[0]
- assert "id" in data[0]
-
-
-@needs_pydanticv1
-def test_create_item(client):
- item = {"title": "Foo", "description": "Something that fights"}
- response = client.post("/users/1/items/", json=item)
- assert response.status_code == 200, response.text
- item_data = response.json()
- assert item["title"] == item_data["title"]
- assert item["description"] == item_data["description"]
- assert "id" in item_data
- assert "owner_id" in item_data
- response = client.get("/users/1")
- assert response.status_code == 200, response.text
- user_data = response.json()
- item_to_check = [it for it in user_data["items"] if it["id"] == item_data["id"]][0]
- assert item_to_check["title"] == item["title"]
- assert item_to_check["description"] == item["description"]
- response = client.get("/users/1")
- assert response.status_code == 200, response.text
- user_data = response.json()
- item_to_check = [it for it in user_data["items"] if it["id"] == item_data["id"]][0]
- assert item_to_check["title"] == item["title"]
- assert item_to_check["description"] == item["description"]
-
-
-@needs_pydanticv1
-def test_read_items(client):
- response = client.get("/items/")
- assert response.status_code == 200, response.text
- data = response.json()
- assert data
- first_item = data[0]
- assert "title" in first_item
- assert "description" in first_item
-
-
-@needs_pydanticv1
-def test_openapi_schema(client):
- response = client.get("/openapi.json")
- assert response.status_code == 200, response.text
- assert response.json() == {
- "openapi": "3.1.0",
- "info": {"title": "FastAPI", "version": "0.1.0"},
- "paths": {
- "/users/": {
- "get": {
- "summary": "Read Users",
- "operationId": "read_users_users__get",
- "parameters": [
- {
- "required": False,
- "schema": {
- "title": "Skip",
- "type": "integer",
- "default": 0,
- },
- "name": "skip",
- "in": "query",
- },
- {
- "required": False,
- "schema": {
- "title": "Limit",
- "type": "integer",
- "default": 100,
- },
- "name": "limit",
- "in": "query",
- },
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {
- "title": "Response Read Users Users Get",
- "type": "array",
- "items": {"$ref": "#/components/schemas/User"},
- }
- }
- },
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- },
- },
- },
- "post": {
- "summary": "Create User",
- "operationId": "create_user_users__post",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {"$ref": "#/components/schemas/UserCreate"}
- }
- },
- "required": True,
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {"$ref": "#/components/schemas/User"}
- }
- },
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- },
- },
- },
- },
- "/users/{user_id}": {
- "get": {
- "summary": "Read User",
- "operationId": "read_user_users__user_id__get",
- "parameters": [
- {
- "required": True,
- "schema": {"title": "User Id", "type": "integer"},
- "name": "user_id",
- "in": "path",
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {"$ref": "#/components/schemas/User"}
- }
- },
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- },
- },
- }
- },
- "/users/{user_id}/items/": {
- "post": {
- "summary": "Create Item For User",
- "operationId": "create_item_for_user_users__user_id__items__post",
- "parameters": [
- {
- "required": True,
- "schema": {"title": "User Id", "type": "integer"},
- "name": "user_id",
- "in": "path",
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {"$ref": "#/components/schemas/ItemCreate"}
- }
- },
- "required": True,
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {"$ref": "#/components/schemas/Item"}
- }
- },
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- },
- },
- }
- },
- "/items/": {
- "get": {
- "summary": "Read Items",
- "operationId": "read_items_items__get",
- "parameters": [
- {
- "required": False,
- "schema": {
- "title": "Skip",
- "type": "integer",
- "default": 0,
- },
- "name": "skip",
- "in": "query",
- },
- {
- "required": False,
- "schema": {
- "title": "Limit",
- "type": "integer",
- "default": 100,
- },
- "name": "limit",
- "in": "query",
- },
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {
- "title": "Response Read Items Items Get",
- "type": "array",
- "items": {"$ref": "#/components/schemas/Item"},
- }
- }
- },
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- },
- },
- }
- },
- "/slowusers/": {
- "get": {
- "summary": "Read Slow Users",
- "operationId": "read_slow_users_slowusers__get",
- "parameters": [
- {
- "required": False,
- "schema": {
- "title": "Skip",
- "type": "integer",
- "default": 0,
- },
- "name": "skip",
- "in": "query",
- },
- {
- "required": False,
- "schema": {
- "title": "Limit",
- "type": "integer",
- "default": 100,
- },
- "name": "limit",
- "in": "query",
- },
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {
- "title": "Response Read Slow Users Slowusers Get",
- "type": "array",
- "items": {"$ref": "#/components/schemas/User"},
- }
- }
- },
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- },
- },
- }
- },
- },
- "components": {
- "schemas": {
- "HTTPValidationError": {
- "title": "HTTPValidationError",
- "type": "object",
- "properties": {
- "detail": {
- "title": "Detail",
- "type": "array",
- "items": {"$ref": "#/components/schemas/ValidationError"},
- }
- },
- },
- "Item": {
- "title": "Item",
- "required": ["title", "id", "owner_id"],
- "type": "object",
- "properties": {
- "title": {"title": "Title", "type": "string"},
- "description": {"title": "Description", "type": "string"},
- "id": {"title": "Id", "type": "integer"},
- "owner_id": {"title": "Owner Id", "type": "integer"},
- },
- },
- "ItemCreate": {
- "title": "ItemCreate",
- "required": ["title"],
- "type": "object",
- "properties": {
- "title": {"title": "Title", "type": "string"},
- "description": {"title": "Description", "type": "string"},
- },
- },
- "User": {
- "title": "User",
- "required": ["email", "id", "is_active"],
- "type": "object",
- "properties": {
- "email": {"title": "Email", "type": "string"},
- "id": {"title": "Id", "type": "integer"},
- "is_active": {"title": "Is Active", "type": "boolean"},
- "items": {
- "title": "Items",
- "type": "array",
- "items": {"$ref": "#/components/schemas/Item"},
- "default": [],
- },
- },
- },
- "UserCreate": {
- "title": "UserCreate",
- "required": ["email", "password"],
- "type": "object",
- "properties": {
- "email": {"title": "Email", "type": "string"},
- "password": {"title": "Password", "type": "string"},
- },
- },
- "ValidationError": {
- "title": "ValidationError",
- "required": ["loc", "msg", "type"],
- "type": "object",
- "properties": {
- "loc": {
- "title": "Location",
- "type": "array",
- "items": {
- "anyOf": [{"type": "string"}, {"type": "integer"}]
- },
- },
- "msg": {"title": "Message", "type": "string"},
- "type": {"title": "Error Type", "type": "string"},
- },
- },
- }
- },
- }