@@ -152,17 +159,17 @@ connect_args={"check_same_thread": False}
这是为了防止意外地为不同的事物(不同的请求)共享相同的连接。
- 但是在 FastAPI 中,普遍使用def函数,多个线程可以为同一个请求与数据库交互,所以我们需要使用`connect_args={"check_same_thread": False}`来让SQLite允许这样。
+ 但是在 FastAPI 中,使用普通函数(def)时,多个线程可以为同一个请求与数据库交互,所以我们需要使用`connect_args={"check_same_thread": False}`来让SQLite允许这样。
此外,我们将确保每个请求都在依赖项中获得自己的数据库连接会话,因此不需要该默认机制。
### 创建一个`SessionLocal`类
-每个实例`SessionLocal`都会是一个数据库会话。当然该类本身还不是数据库会话。
+每个`SessionLocal`类的实例都会是一个数据库会话。当然该类本身还不是数据库会话。
但是一旦我们创建了一个`SessionLocal`类的实例,这个实例将是实际的数据库会话。
-我们命名它是`SessionLocal`为了将它与我们从 SQLAlchemy 导入的`Session`区别开来。
+我们将它命名为`SessionLocal`是为了将它与我们从 SQLAlchemy 导入的`Session`区别开来。
稍后我们将使用`Session`(从 SQLAlchemy 导入的那个)。
@@ -176,7 +183,7 @@ connect_args={"check_same_thread": False}
现在我们将使用`declarative_base()`返回一个类。
-稍后我们将用这个类继承,来创建每个数据库模型或类(ORM 模型):
+稍后我们将继承这个类,来创建每个数据库模型或类(ORM 模型):
```Python hl_lines="13"
{!../../../docs_src/sql_databases/sql_app/database.py!}
@@ -209,7 +216,7 @@ connect_args={"check_same_thread": False}
### 创建模型属性/列
-现在创建所有模型(类)属性。
+现在创建所有模型(类)的属性。
这些属性中的每一个都代表其相应数据库表中的一列。
@@ -252,13 +259,13 @@ connect_args={"check_same_thread": False}
### 创建初始 Pydantic*模型*/模式
-创建一个`ItemBase`和`UserBase`Pydantic*模型*(或者我们说“schema”)以及在创建或读取数据时具有共同的属性。
+创建一个`ItemBase`和`UserBase`Pydantic*模型*(或者我们说“schema”),他们拥有创建或读取数据时具有的共同属性。
-`ItemCreate`为 创建一个`UserCreate`继承自它们的所有属性(因此它们将具有相同的属性),以及创建所需的任何其他数据(属性)。
+然后创建一个继承自他们的`ItemCreate`和`UserCreate`,并添加创建时所需的其他数据(或属性)。
因此在创建时也应当有一个`password`属性。
-但是为了安全起见,`password`不会出现在其他同类 Pydantic*模型*中,例如用户请求时不应该从 API 返回响应中包含它。
+但是为了安全起见,`password`不会出现在其他同类 Pydantic*模型*中,例如通过API读取一个用户数据时,它不应当包含在内。
=== "Python 3.10+"
@@ -368,7 +375,7 @@ Pydantic`orm_mode`将告诉 Pydantic*模型*读取数据,即它不是一个`di
id = data["id"]
```
-尝试从属性中获取它,如:
+它还会尝试从属性中获取它,如:
```Python
id = data.id
@@ -404,7 +411,7 @@ current_user.items
在这个文件中,我们将编写可重用的函数用来与数据库中的数据进行交互。
-**CRUD**分别为:**增加**、**查询**、**更改**和**删除**,即增删改查。
+**CRUD**分别为:增加(**C**reate)、查询(**R**ead)、更改(**U**pdate)、删除(**D**elete),即增删改查。
...虽然在这个例子中我们只是新增和查询。
@@ -414,7 +421,7 @@ current_user.items
导入之前的`models`(SQLAlchemy 模型)和`schemas`(Pydantic*模型*/模式)。
-创建一些实用函数来完成:
+创建一些工具函数来完成:
* 通过 ID 和电子邮件查询单个用户。
* 查询多个用户。
@@ -429,14 +436,14 @@ current_user.items
### 创建数据
-现在创建实用程序函数来创建数据。
+现在创建工具函数来创建数据。
它的步骤是:
* 使用您的数据创建一个 SQLAlchemy 模型*实例。*
-* 使用`add`来将该实例对象添加到您的数据库。
-* 使用`commit`来对数据库的事务提交(以便保存它们)。
-* 使用`refresh`来刷新您的数据库实例(以便它包含来自数据库的任何新数据,例如生成的 ID)。
+* 使用`add`来将该实例对象添加到数据库会话。
+* 使用`commit`来将更改提交到数据库(以便保存它们)。
+* 使用`refresh`来刷新您的实例对象(以便它包含来自数据库的任何新数据,例如生成的 ID)。
```Python hl_lines="18-24 31-36"
{!../../../docs_src/sql_databases/sql_app/crud.py!}
@@ -505,11 +512,11 @@ current_user.items
现在使用我们在`sql_app/database.py`文件中创建的`SessionLocal`来创建依赖项。
-我们需要每个请求有一个独立的数据库会话/连接(`SessionLocal`),在所有请求中使用相同的会话,然后在请求完成后关闭它。
+我们需要每个请求有一个独立的数据库会话/连接(`SessionLocal`),在整个请求中使用相同的会话,然后在请求完成后关闭它。
然后将为下一个请求创建一个新会话。
-为此,我们将创建一个新的依赖项`yield`,正如前面关于[Dependencies with`yield`](https://fastapi.tiangolo.com/zh/tutorial/dependencies/dependencies-with-yield/)的部分中所解释的那样。
+为此,我们将创建一个包含`yield`的依赖项,正如前面关于[Dependencies with`yield`](https://fastapi.tiangolo.com/zh/tutorial/dependencies/dependencies-with-yield/)的部分中所解释的那样。
我们的依赖项将创建一个新的 SQLAlchemy `SessionLocal`,它将在单个请求中使用,然后在请求完成后关闭它。
@@ -729,13 +736,13 @@ $ uvicorn sql_app.main:app --reload
## 中间件替代数据库会话
-如果你不能使用依赖项`yield`——例如,如果你没有使用**Python 3.7**并且不能安装上面提到的**Python 3.6**的“backports” ——你可以在类似的“中间件”中设置会话方法。
+如果你不能使用带有`yield`的依赖项——例如,如果你没有使用**Python 3.7**并且不能安装上面提到的**Python 3.6**的“backports” ——你可以使用类似的方法在“中间件”中设置会话。
-“中间件”基本功能是一个为每个请求执行的函数在请求之前进行执行相应的代码,以及在请求执行之后执行相应的代码。
+“中间件”基本上是一个对每个请求都执行的函数,其中一些代码在端点函数之前执行,另一些代码在端点函数之后执行。
### 创建中间件
-我们将添加中间件(只是一个函数)将为每个请求创建一个新的 SQLAlchemy`SessionLocal`,将其添加到请求中,然后在请求完成后关闭它。
+我们要添加的中间件(只是一个函数)将为每个请求创建一个新的 SQLAlchemy`SessionLocal`,将其添加到请求中,然后在请求完成后关闭它。
=== "Python 3.9+"
@@ -760,7 +767,7 @@ $ uvicorn sql_app.main:app --reload
`request.state`是每个`Request`对象的属性。它用于存储附加到请求本身的任意对象,例如本例中的数据库会话。您可以在[Starlette 的关于`Request`state](https://www.starlette.io/requests/#other-state)的文档中了解更多信息。
-对于这种情况下,它帮助我们确保在所有请求中使用单个数据库会话,然后关闭(在中间件中)。
+对于这种情况下,它帮助我们确保在整个请求中使用单个数据库会话,然后关闭(在中间件中)。
### 使用`yield`依赖项与使用中间件的区别
@@ -776,9 +783,9 @@ $ uvicorn sql_app.main:app --reload
* 即使处理该请求的*路径操作*不需要数据库。
!!! tip
- `tyield`当依赖项 足以满足用例时,使用`tyield`依赖项方法会更好。
+ 最好使用带有yield的依赖项,如果这足够满足用例需求
!!! info
- `yield`的依赖项是最近刚加入**FastAPI**中的。
+ 带有`yield`的依赖项是最近刚加入**FastAPI**中的。
所以本教程的先前版本只有带有中间件的示例,并且可能有多个应用程序使用中间件进行数据库会话管理。
From 17c1ae886ba03964440e309d61e6ed92d5dd4382 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 7 May 2024 21:00:47 +0000
Subject: [PATCH 008/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 507dec5b3..205b3c805 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -13,6 +13,7 @@ hide:
### Translations
+* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/sql-databases.md`. PR [#11539](https://github.com/tiangolo/fastapi/pull/11539) by [@chaoless](https://github.com/chaoless).
* 🌐 Add Chinese translation for `docs/zh/docs/how-to/configure-swagger-ui.md`. PR [#11501](https://github.com/tiangolo/fastapi/pull/11501) by [@Lucas-lyh](https://github.com/Lucas-lyh).
* 🌐 Update Chinese translation for `/docs/advanced/security/http-basic-auth.md`. PR [#11512](https://github.com/tiangolo/fastapi/pull/11512) by [@nick-cjyx9](https://github.com/nick-cjyx9).
From 8187c54c730dc711288dc2027b07feffa5b1c6bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hasan=20Sezer=20Ta=C5=9Fan?=
<13135006+hasansezertasan@users.noreply.github.com>
Date: Wed, 8 May 2024 22:10:46 +0300
Subject: [PATCH 009/366] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translat?=
=?UTF-8?q?ion=20for=20`docs/tr/docs/tutorial/request-forms.md`=20(#11553)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/tr/docs/tutorial/request-forms.md | 92 ++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
create mode 100644 docs/tr/docs/tutorial/request-forms.md
diff --git a/docs/tr/docs/tutorial/request-forms.md b/docs/tr/docs/tutorial/request-forms.md
new file mode 100644
index 000000000..2728b6164
--- /dev/null
+++ b/docs/tr/docs/tutorial/request-forms.md
@@ -0,0 +1,92 @@
+# Form Verisi
+
+İstek gövdesinde JSON verisi yerine form alanlarını karşılamanız gerketiğinde `Form` sınıfını kullanabilirsiniz.
+
+!!! info "Bilgi"
+ Formları kullanmak için öncelikle `python-multipart` paketini indirmeniz gerekmektedir.
+
+ Örneğin `pip install python-multipart`.
+
+## `Form` Sınıfını Projenize Dahil Edin
+
+`Form` sınıfını `fastapi`'den projenize dahil edin:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/request_forms/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_forms/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ Prefer to use the `Annotated` version if possible.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_forms/tutorial001.py!}
+ ```
+
+## `Form` Parametrelerini Tanımlayın
+
+Form parametrelerini `Body` veya `Query` için yaptığınız gibi oluşturun:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/request_forms/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/request_forms/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ Prefer to use the `Annotated` version if possible.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/request_forms/tutorial001.py!}
+ ```
+
+Örneğin, OAuth2 spesifikasyonunun kullanılabileceği ("şifre akışı" olarak adlandırılan) yollardan birinde, form alanları olarak "username" ve "password" gönderilmesi gerekir.
+
+Bu spesifikasyon form alanlarını adlandırırken isimlerinin birebir `username` ve `password` olmasını ve JSON verisi yerine form verisi olarak gönderilmesini gerektirir.
+
+`Form` sınıfıyla tanımlama yaparken `Body`, `Query`, `Path` ve `Cookie` sınıflarında kullandığınız aynı validasyon, örnekler, isimlendirme (örneğin `username` yerine `user-name` kullanımı) ve daha fazla konfigurasyonu kullanabilirsiniz.
+
+!!! info "Bilgi"
+ `Form` doğrudan `Body` sınıfını miras alan bir sınıftır.
+
+!!! tip "İpucu"
+ Form gövdelerini tanımlamak için `Form` sınıfını kullanmanız gerekir; çünkü bu olmadan parametreler sorgu parametreleri veya gövde (JSON) parametreleri olarak yorumlanır.
+
+## "Form Alanları" Hakkında
+
+HTML formlarının (``) verileri sunucuya gönderirken JSON'dan farklı özel bir kodlama kullanır.
+
+**FastAPI** bu verilerin JSON yerine doğru şekilde okunmasını sağlayacaktır.
+
+!!! note "Teknik Detaylar"
+ Form verileri normalde `application/x-www-form-urlencoded` medya tipiyle kodlanır.
+
+ Ancak form içerisinde dosyalar yer aldığında `multipart/form-data` olarak kodlanır. Bir sonraki bölümde dosyaların işlenmesi hakkında bilgi edineceksiniz.
+
+ Form kodlama türleri ve form alanları hakkında daha fazla bilgi edinmek istiyorsanız MDN web docs for POST
sayfasını ziyaret edebilirsiniz.
+
+!!! warning "Uyarı"
+ *Yol operasyonları* içerisinde birden fazla `Form` parametresi tanımlayabilirsiniz ancak bunlarla birlikte JSON verisi kabul eden `Body` alanları tanımlayamazsınız çünkü bu durumda istek gövdesi `application/json` yerine `application/x-www-form-urlencoded` ile kodlanmış olur.
+
+ Bu **FastAPI**'ın getirdiği bir kısıtlama değildir, HTTP protokolünün bir parçasıdır.
+
+## Özet
+
+Form verisi girdi parametreleri tanımlamak için `Form` sınıfını kullanın.
From 9642ff26375e44d35f6dbdc473680bacbc82e737 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 8 May 2024 19:11:08 +0000
Subject: [PATCH 010/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 205b3c805..97845718d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,8 @@ hide:
## Latest Changes
+* 🌐 Add Turkish translation for `docs/tr/docs/tutorial/request-forms.md`. PR [#11553](https://github.com/tiangolo/fastapi/pull/11553) by [@hasansezertasan](https://github.com/hasansezertasan).
+
### Docs
* ✏️ Fix link in `fastapi-cli.md`. PR [#11524](https://github.com/tiangolo/fastapi/pull/11524) by [@svlandeg](https://github.com/svlandeg).
From 722107fe60c3da3bfe56428079ee2132082ebee9 Mon Sep 17 00:00:00 2001
From: Tamir Duberstein
Date: Thu, 9 May 2024 20:30:25 -0400
Subject: [PATCH 011/366] =?UTF-8?q?=F0=9F=91=B7=20Update=20GitHub=20action?=
=?UTF-8?q?s=20to=20download=20and=20upload=20artifacts=20to=20v4,=20for?=
=?UTF-8?q?=20docs=20and=20coverage=20(#11550)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez
---
.github/workflows/build-docs.yml | 4 ++--
.github/workflows/deploy-docs.yml | 16 +++++++---------
.github/workflows/test.yml | 11 ++++++-----
3 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
index 4ff5e26cb..262c7fa5c 100644
--- a/.github/workflows/build-docs.yml
+++ b/.github/workflows/build-docs.yml
@@ -108,9 +108,9 @@ jobs:
path: docs/${{ matrix.lang }}/.cache
- name: Build Docs
run: python ./scripts/docs.py build-lang ${{ matrix.lang }}
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
with:
- name: docs-site
+ name: docs-site-${{ matrix.lang }}
path: ./site/**
# https://github.com/marketplace/actions/alls-green#why
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
index b8dbb7dc5..dd54608d9 100644
--- a/.github/workflows/deploy-docs.yml
+++ b/.github/workflows/deploy-docs.yml
@@ -19,18 +19,16 @@ jobs:
run: |
rm -rf ./site
mkdir ./site
- - name: Download Artifact Docs
- id: download
- uses: dawidd6/action-download-artifact@v3.1.4
+ - uses: actions/download-artifact@v4
with:
- if_no_artifact_found: ignore
- github_token: ${{ secrets.FASTAPI_PREVIEW_DOCS_DOWNLOAD_ARTIFACTS }}
- workflow: build-docs.yml
- run_id: ${{ github.event.workflow_run.id }}
- name: docs-site
path: ./site/
+ pattern: docs-site-*
+ merge-multiple: true
+ github-token: ${{ secrets.FASTAPI_PREVIEW_DOCS_DOWNLOAD_ARTIFACTS }}
+ run-id: ${{ github.event.workflow_run.id }}
- name: Deploy to Cloudflare Pages
- if: steps.download.outputs.found_artifact == 'true'
+ # hashFiles returns an empty string if there are no files
+ if: hashFiles('./site/*')
id: deploy
uses: cloudflare/pages-action@v1
with:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index fe1e419d6..a33b6a68a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -87,9 +87,9 @@ jobs:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
- name: Store coverage files
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
- name: coverage
+ name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
path: coverage
coverage-combine:
@@ -108,17 +108,18 @@ jobs:
# cache: "pip"
# cache-dependency-path: pyproject.toml
- name: Get coverage files
- uses: actions/download-artifact@v3
+ uses: actions/download-artifact@v4
with:
- name: coverage
+ pattern: coverage-*
path: coverage
+ merge-multiple: true
- run: pip install coverage[toml]
- run: ls -la coverage
- run: coverage combine coverage
- run: coverage report
- run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
- name: Store coverage HTML
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: coverage-html
path: htmlcov
From e82e6479f28594142e6ddbae21111f5abf3b8e65 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Fri, 10 May 2024 00:30:46 +0000
Subject: [PATCH 012/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 97845718d..61b1023a8 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -21,6 +21,7 @@ hide:
### Internal
+* 👷 Update GitHub actions to download and upload artifacts to v4, for docs and coverage. PR [#11550](https://github.com/tiangolo/fastapi/pull/11550) by [@tamird](https://github.com/tamird).
* 👷 Tweak CI for test-redistribute, add needed env vars for slim. PR [#11549](https://github.com/tiangolo/fastapi/pull/11549) by [@tiangolo](https://github.com/tiangolo).
* 👥 Update FastAPI People. PR [#11511](https://github.com/tiangolo/fastapi/pull/11511) by [@tiangolo](https://github.com/tiangolo).
From 1f0eecba8153317eba70bc73328943ecb331aff6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Thu, 9 May 2024 17:48:58 -0700
Subject: [PATCH 013/366] =?UTF-8?q?=F0=9F=91=B7=20Update=20Smokeshow=20dow?=
=?UTF-8?q?nload=20artifact=20GitHub=20Action=20(#11562)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/smokeshow.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/smokeshow.yml b/.github/workflows/smokeshow.yml
index c4043cc6a..2620da839 100644
--- a/.github/workflows/smokeshow.yml
+++ b/.github/workflows/smokeshow.yml
@@ -24,11 +24,11 @@ jobs:
- run: pip install smokeshow
- - uses: dawidd6/action-download-artifact@v3.1.4
+ - uses: actions/download-artifact@v4
with:
- github_token: ${{ secrets.FASTAPI_SMOKESHOW_DOWNLOAD_ARTIFACTS }}
- workflow: test.yml
- commit: ${{ github.event.workflow_run.head_sha }}
+ name: coverage-html
+ github-token: ${{ secrets.FASTAPI_SMOKESHOW_DOWNLOAD_ARTIFACTS }}
+ run-id: ${{ github.event.workflow_run.id }}
- run: smokeshow upload coverage-html
env:
From 2c6fb2ecd1de2668dd7dbb16c5931b290256f60b Mon Sep 17 00:00:00 2001
From: github-actions
Date: Fri, 10 May 2024 00:49:28 +0000
Subject: [PATCH 014/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 61b1023a8..6b28a8f74 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -21,6 +21,7 @@ hide:
### Internal
+* 👷 Update Smokeshow download artifact GitHub Action. PR [#11562](https://github.com/tiangolo/fastapi/pull/11562) by [@tiangolo](https://github.com/tiangolo).
* 👷 Update GitHub actions to download and upload artifacts to v4, for docs and coverage. PR [#11550](https://github.com/tiangolo/fastapi/pull/11550) by [@tamird](https://github.com/tamird).
* 👷 Tweak CI for test-redistribute, add needed env vars for slim. PR [#11549](https://github.com/tiangolo/fastapi/pull/11549) by [@tiangolo](https://github.com/tiangolo).
* 👥 Update FastAPI People. PR [#11511](https://github.com/tiangolo/fastapi/pull/11511) by [@tiangolo](https://github.com/tiangolo).
From efeee95db7775dad468d6b4e77e8f1031062a167 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Thu, 9 May 2024 18:06:31 -0700
Subject: [PATCH 015/366] =?UTF-8?q?=F0=9F=91=B7=20Update=20Smokeshow,=20fi?=
=?UTF-8?q?x=20sync=20download=20artifact=20and=20smokeshow=20configs=20(#?=
=?UTF-8?q?11563)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/smokeshow.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/smokeshow.yml b/.github/workflows/smokeshow.yml
index 2620da839..ffc9c5f8a 100644
--- a/.github/workflows/smokeshow.yml
+++ b/.github/workflows/smokeshow.yml
@@ -27,10 +27,11 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: coverage-html
+ path: htmlcov
github-token: ${{ secrets.FASTAPI_SMOKESHOW_DOWNLOAD_ARTIFACTS }}
run-id: ${{ github.event.workflow_run.id }}
- - run: smokeshow upload coverage-html
+ - run: smokeshow upload htmlcov
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 100
From af60d6d8ead9c924b7a65d349cb9d29e9c117d13 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Fri, 10 May 2024 01:06:55 +0000
Subject: [PATCH 016/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 6b28a8f74..1e55c4af9 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -21,6 +21,7 @@ hide:
### Internal
+* 👷 Update Smokeshow, fix sync download artifact and smokeshow configs. PR [#11563](https://github.com/tiangolo/fastapi/pull/11563) by [@tiangolo](https://github.com/tiangolo).
* 👷 Update Smokeshow download artifact GitHub Action. PR [#11562](https://github.com/tiangolo/fastapi/pull/11562) by [@tiangolo](https://github.com/tiangolo).
* 👷 Update GitHub actions to download and upload artifacts to v4, for docs and coverage. PR [#11550](https://github.com/tiangolo/fastapi/pull/11550) by [@tamird](https://github.com/tamird).
* 👷 Tweak CI for test-redistribute, add needed env vars for slim. PR [#11549](https://github.com/tiangolo/fastapi/pull/11549) by [@tiangolo](https://github.com/tiangolo).
From dfa75c15877592d8662c5e74ff53b36f4f8a61c5 Mon Sep 17 00:00:00 2001
From: s111d
Date: Mon, 13 May 2024 03:58:32 +0300
Subject: [PATCH 017/366] =?UTF-8?q?=F0=9F=8C=90=20Add=20Russian=20translat?=
=?UTF-8?q?ion=20for=20`docs/ru/docs/about/index.md`=20(#10961)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/ru/docs/about/index.md | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 docs/ru/docs/about/index.md
diff --git a/docs/ru/docs/about/index.md b/docs/ru/docs/about/index.md
new file mode 100644
index 000000000..1015b667a
--- /dev/null
+++ b/docs/ru/docs/about/index.md
@@ -0,0 +1,3 @@
+# О проекте
+
+FastAPI: внутреннее устройство, повлиявшие технологии и всё такое прочее. 🤓
From 038e1142d7e482d6a2ec6c1ae05f0d53f5861ff9 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Mon, 13 May 2024 00:58:56 +0000
Subject: [PATCH 018/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 1e55c4af9..db10e78c1 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -15,6 +15,7 @@ hide:
### Translations
+* 🌐 Add Russian translation for `docs/ru/docs/about/index.md`. PR [#10961](https://github.com/tiangolo/fastapi/pull/10961) by [@s111d](https://github.com/s111d).
* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/sql-databases.md`. PR [#11539](https://github.com/tiangolo/fastapi/pull/11539) by [@chaoless](https://github.com/chaoless).
* 🌐 Add Chinese translation for `docs/zh/docs/how-to/configure-swagger-ui.md`. PR [#11501](https://github.com/tiangolo/fastapi/pull/11501) by [@Lucas-lyh](https://github.com/Lucas-lyh).
* 🌐 Update Chinese translation for `/docs/advanced/security/http-basic-auth.md`. PR [#11512](https://github.com/tiangolo/fastapi/pull/11512) by [@nick-cjyx9](https://github.com/nick-cjyx9).
From 61ab73ea0fa3c19207a5a65770771d6b98f67d95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hasan=20Sezer=20Ta=C5=9Fan?=
<13135006+hasansezertasan@users.noreply.github.com>
Date: Tue, 14 May 2024 22:35:04 +0300
Subject: [PATCH 019/366] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translat?=
=?UTF-8?q?ion=20for=20`docs/tr/docs/tutorial/cookie-params.md`=20(#11561)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/tr/docs/tutorial/cookie-params.md | 97 ++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
create mode 100644 docs/tr/docs/tutorial/cookie-params.md
diff --git a/docs/tr/docs/tutorial/cookie-params.md b/docs/tr/docs/tutorial/cookie-params.md
new file mode 100644
index 000000000..4a66f26eb
--- /dev/null
+++ b/docs/tr/docs/tutorial/cookie-params.md
@@ -0,0 +1,97 @@
+# Çerez (Cookie) Parametreleri
+
+`Query` (Sorgu) ve `Path` (Yol) parametrelerini tanımladığınız şekilde çerez parametreleri tanımlayabilirsiniz.
+
+## Import `Cookie`
+
+Öncelikle, `Cookie`'yi projenize dahil edin:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ non-Annotated"
+
+ !!! tip "İpucu"
+ Mümkün mertebe 'Annotated' sınıfını kullanmaya çalışın.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip "İpucu"
+ Mümkün mertebe 'Annotated' sınıfını kullanmaya çalışın.
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001.py!}
+ ```
+
+## `Cookie` Parametrelerini Tanımlayın
+
+Çerez parametrelerini `Path` veya `Query` tanımlaması yapar gibi tanımlayın.
+
+İlk değer varsayılan değerdir; tüm ekstra doğrulama veya belirteç parametrelerini kullanabilirsiniz:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/cookie_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ non-Annotated"
+
+ !!! tip "İpucu"
+ Mümkün mertebe 'Annotated' sınıfını kullanmaya çalışın.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip "İpucu"
+ Mümkün mertebe 'Annotated' sınıfını kullanmaya çalışın.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001.py!}
+ ```
+
+!!! note "Teknik Detaylar"
+ `Cookie` sınıfı `Path` ve `Query` sınıflarının kardeşidir. Diğerleri gibi `Param` sınıfını miras alan bir sınıftır.
+
+ Ancak `fastapi`'dan projenize dahil ettiğiniz `Query`, `Path`, `Cookie` ve diğerleri aslında özel sınıflar döndüren birer fonksiyondur.
+
+!!! info "Bilgi"
+ Çerez tanımlamak için `Cookie` sınıfını kullanmanız gerekmektedir, aksi taktirde parametreler sorgu parametreleri olarak yorumlanır.
+
+## Özet
+
+Çerez tanımlamalarını `Cookie` sınıfını kullanarak `Query` ve `Path` tanımlar gibi tanımlayın.
From a32902606e8d7abab83a636293d62aff52fd2429 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 14 May 2024 19:35:25 +0000
Subject: [PATCH 020/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index db10e78c1..b92a58edf 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -15,6 +15,7 @@ hide:
### Translations
+* 🌐 Add Turkish translation for `docs/tr/docs/tutorial/cookie-params.md`. PR [#11561](https://github.com/tiangolo/fastapi/pull/11561) by [@hasansezertasan](https://github.com/hasansezertasan).
* 🌐 Add Russian translation for `docs/ru/docs/about/index.md`. PR [#10961](https://github.com/tiangolo/fastapi/pull/10961) by [@s111d](https://github.com/s111d).
* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/sql-databases.md`. PR [#11539](https://github.com/tiangolo/fastapi/pull/11539) by [@chaoless](https://github.com/chaoless).
* 🌐 Add Chinese translation for `docs/zh/docs/how-to/configure-swagger-ui.md`. PR [#11501](https://github.com/tiangolo/fastapi/pull/11501) by [@Lucas-lyh](https://github.com/Lucas-lyh).
From 817cc1d7548a508f80a346eb18889e29177ec03c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petar=20Mari=C4=87?=
Date: Sat, 18 May 2024 02:48:03 +0200
Subject: [PATCH 021/366] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo=20in=20?=
=?UTF-8?q?`fastapi/applications.py`=20(#11593)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
fastapi/applications.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fastapi/applications.py b/fastapi/applications.py
index 4446cacfb..4f5e6f1d9 100644
--- a/fastapi/applications.py
+++ b/fastapi/applications.py
@@ -902,7 +902,7 @@ class FastAPI(Starlette):
A state object for the application. This is the same object for the
entire application, it doesn't change from request to request.
- You normally woudln't use this in FastAPI, for most of the cases you
+ You normally wouldn't use this in FastAPI, for most of the cases you
would instead use FastAPI dependencies.
This is simply inherited from Starlette.
From 1dae11ce50873fb6f56a6b5d25b0d79bdfbc638a Mon Sep 17 00:00:00 2001
From: github-actions
Date: Sat, 18 May 2024 00:48:23 +0000
Subject: [PATCH 022/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index b92a58edf..90c44bfaa 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -11,6 +11,7 @@ hide:
### Docs
+* ✏️ Fix typo in `fastapi/applications.py`. PR [#11593](https://github.com/tiangolo/fastapi/pull/11593) by [@petarmaric](https://github.com/petarmaric).
* ✏️ Fix link in `fastapi-cli.md`. PR [#11524](https://github.com/tiangolo/fastapi/pull/11524) by [@svlandeg](https://github.com/svlandeg).
### Translations
From 23bc02c45a59509caba858a7afca076d4edbb784 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hasan=20Sezer=20Ta=C5=9Fan?=
<13135006+hasansezertasan@users.noreply.github.com>
Date: Sat, 18 May 2024 03:49:03 +0300
Subject: [PATCH 023/366] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translat?=
=?UTF-8?q?ion=20for=20`docs/tr/docs/advanced/wsgi.md`=20(#11575)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/tr/docs/advanced/wsgi.md | 37 +++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 docs/tr/docs/advanced/wsgi.md
diff --git a/docs/tr/docs/advanced/wsgi.md b/docs/tr/docs/advanced/wsgi.md
new file mode 100644
index 000000000..54a6f20e2
--- /dev/null
+++ b/docs/tr/docs/advanced/wsgi.md
@@ -0,0 +1,37 @@
+# WSGI - Flask, Django ve Daha Fazlasını FastAPI ile Kullanma
+
+WSGI uygulamalarını [Sub Applications - Mounts](sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](behind-a-proxy.md){.internal-link target=_blank} bölümlerinde gördüğünüz gibi bağlayabilirsiniz.
+
+Bunun için `WSGIMiddleware` ile Flask, Django vb. WSGI uygulamanızı sarmalayabilir ve FastAPI'ya bağlayabilirsiniz.
+
+## `WSGIMiddleware` Kullanımı
+
+`WSGIMiddleware`'ı projenize dahil edin.
+
+Ardından WSGI (örneğin Flask) uygulamanızı middleware ile sarmalayın.
+
+Son olarak da bir yol altında bağlama işlemini gerçekleştirin.
+
+```Python hl_lines="2-3 23"
+{!../../../docs_src/wsgi/tutorial001.py!}
+```
+
+## Kontrol Edelim
+
+Artık `/v1/` yolunun altındaki her istek Flask uygulaması tarafından işlenecektir.
+
+Geri kalanı ise **FastAPI** tarafından işlenecektir.
+
+Eğer uygulamanızı çalıştırıp http://localhost:8000/v1/ adresine giderseniz, Flask'tan gelen yanıtı göreceksiniz:
+
+```txt
+Hello, World from Flask!
+```
+
+Eğer http://localhost:8000/v2/ adresine giderseniz, FastAPI'dan gelen yanıtı göreceksiniz:
+
+```JSON
+{
+ "message": "Hello World"
+}
+```
From d4ce9d5a4a6913ec37ccadaa961d20f7394e78c0 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Sat, 18 May 2024 00:49:30 +0000
Subject: [PATCH 024/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 90c44bfaa..a2d3afe4b 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -16,6 +16,7 @@ hide:
### Translations
+* 🌐 Add Turkish translation for `docs/tr/docs/advanced/wsgi.md`. PR [#11575](https://github.com/tiangolo/fastapi/pull/11575) by [@hasansezertasan](https://github.com/hasansezertasan).
* 🌐 Add Turkish translation for `docs/tr/docs/tutorial/cookie-params.md`. PR [#11561](https://github.com/tiangolo/fastapi/pull/11561) by [@hasansezertasan](https://github.com/hasansezertasan).
* 🌐 Add Russian translation for `docs/ru/docs/about/index.md`. PR [#10961](https://github.com/tiangolo/fastapi/pull/10961) by [@s111d](https://github.com/s111d).
* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/sql-databases.md`. PR [#11539](https://github.com/tiangolo/fastapi/pull/11539) by [@chaoless](https://github.com/chaoless).
From 22b033ebd71b97a112e39db6b2819df9a75f7e79 Mon Sep 17 00:00:00 2001
From: Igor Sulim <30448496+isulim@users.noreply.github.com>
Date: Sat, 18 May 2024 02:50:03 +0200
Subject: [PATCH 025/366] =?UTF-8?q?=F0=9F=8C=90=20Polish=20translation=20f?=
=?UTF-8?q?or=20`docs/pl/docs/fastapi-people.md`=20(#10196)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/pl/docs/fastapi-people.md | 178 +++++++++++++++++++++++++++++++++
1 file changed, 178 insertions(+)
create mode 100644 docs/pl/docs/fastapi-people.md
diff --git a/docs/pl/docs/fastapi-people.md b/docs/pl/docs/fastapi-people.md
new file mode 100644
index 000000000..b244ab489
--- /dev/null
+++ b/docs/pl/docs/fastapi-people.md
@@ -0,0 +1,178 @@
+# Ludzie FastAPI
+
+FastAPI posiada wspaniałą społeczność, która jest otwarta dla ludzi z każdego środowiska.
+
+## Twórca - Opienik
+
+Cześć! 👋
+
+To ja:
+
+{% if people %}
+
+{% for user in people.maintainers %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+Jestem twórcą i opiekunem **FastAPI**. Możesz przeczytać więcej na ten temat w [Pomoc FastAPI - Uzyskaj pomoc - Skontaktuj się z autorem](help-fastapi.md#connect-with-the-author){.internal-link target=_blank}.
+
+...Ale tutaj chcę pokazać Ci społeczność.
+
+---
+
+**FastAPI** otrzymuje wiele wsparcia od społeczności. Chciałbym podkreślić ich wkład.
+
+To są ludzie, którzy:
+
+* [Pomagają innym z pytaniami na GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank}.
+* [Tworzą Pull Requesty](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}.
+* Oceniają Pull Requesty, [to szczególnie ważne dla tłumaczeń](contributing.md#translations){.internal-link target=_blank}.
+
+Proszę o brawa dla nich. 👏 🙇
+
+## Najaktywniejsi użytkownicy w zeszłym miesiącu
+
+Oto niektórzy użytkownicy, którzy [pomagali innym w największej liczbie pytań na GitHubie](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} podczas ostatniego miesiąca. ☕
+
+{% if people %}
+
+{% for user in people.last_month_active %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+## Eksperci
+
+Oto **eksperci FastAPI**. 🤓
+
+To użytkownicy, którzy [pomogli innym z największa liczbą pytań na GitHubie](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} od *samego początku*.
+
+Poprzez pomoc wielu innym, udowodnili, że są ekspertami. ✨
+
+{% if people %}
+
+{% for user in people.experts %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+## Najlepsi Kontrybutorzy
+
+Oto **Najlepsi Kontrybutorzy**. 👷
+
+Ci użytkownicy [stworzyli najwięcej Pull Requestów](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}, które zostały *wcalone*.
+
+Współtworzyli kod źródłowy, dokumentację, tłumaczenia itp. 📦
+
+{% if people %}
+
+{% for user in people.top_contributors %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+Jest wielu więcej kontrybutorów (ponad setka), możesz zobaczyć ich wszystkich na stronie Kontrybutorzy FastAPI na GitHub. 👷
+
+## Najlepsi Oceniajacy
+
+Ci uzytkownicy są **Najlepszymi oceniającymi**. 🕵️
+
+### Oceny Tłumaczeń
+
+Ja mówię tylko kilkoma językami (i to niezbyt dobrze 😅). Zatem oceniający są tymi, którzy mają [**moc zatwierdzania tłumaczeń**](contributing.md#translations){.internal-link target=_blank} dokumentacji. Bez nich nie byłoby dokumentacji w kilku innych językach.
+
+---
+
+**Najlepsi Oceniający** 🕵️ przejrzeli więcej Pull Requestów, niż inni, zapewniając jakość kodu, dokumentacji, a zwłaszcza **tłumaczeń**.
+
+{% if people %}
+
+{% for user in people.top_reviewers %}
+
+
+{% endfor %}
+
+
+{% endif %}
+
+## Sponsorzy
+
+Oto **Sponsorzy**. 😎
+
+Wspierają moją pracę nad **FastAPI** (i innymi), głównie poprzez GitHub Sponsors.
+
+{% if sponsors %}
+
+{% if sponsors.gold %}
+
+### Złoci Sponsorzy
+
+{% for sponsor in sponsors.gold -%}
+
+{% endfor %}
+{% endif %}
+
+{% if sponsors.silver %}
+
+### Srebrni Sponsorzy
+
+{% for sponsor in sponsors.silver -%}
+
+{% endfor %}
+{% endif %}
+
+{% if sponsors.bronze %}
+
+### Brązowi Sponsorzy
+
+{% for sponsor in sponsors.bronze -%}
+
+{% endfor %}
+{% endif %}
+
+{% endif %}
+
+### Indywidualni Sponsorzy
+
+{% 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 %}
+
+## Techniczne szczegóły danych
+
+Głównym celem tej strony jest podkreślenie wysiłku społeczności w pomaganiu innym.
+
+Szczególnie włączając wysiłki, które są zwykle mniej widoczne, a w wielu przypadkach bardziej żmudne, tak jak pomaganie innym z pytaniami i ocenianie Pull Requestów z tłumaczeniami.
+
+Dane są obliczane każdego miesiąca, możesz przeczytać kod źródłowy tutaj.
+
+Tutaj również podkreślam wkład od sponsorów.
+
+Zastrzegam sobie prawo do aktualizacji algorytmu, sekcji, progów itp. (na wszelki wypadek 🤷).
From ad85917f618bb8073c43fc06378d9140f2373e87 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Sat, 18 May 2024 00:52:09 +0000
Subject: [PATCH 026/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index a2d3afe4b..58d15c494 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -16,6 +16,7 @@ hide:
### Translations
+* 🌐 Polish translation for `docs/pl/docs/fastapi-people.md`. PR [#10196](https://github.com/tiangolo/fastapi/pull/10196) by [@isulim](https://github.com/isulim).
* 🌐 Add Turkish translation for `docs/tr/docs/advanced/wsgi.md`. PR [#11575](https://github.com/tiangolo/fastapi/pull/11575) by [@hasansezertasan](https://github.com/hasansezertasan).
* 🌐 Add Turkish translation for `docs/tr/docs/tutorial/cookie-params.md`. PR [#11561](https://github.com/tiangolo/fastapi/pull/11561) by [@hasansezertasan](https://github.com/hasansezertasan).
* 🌐 Add Russian translation for `docs/ru/docs/about/index.md`. PR [#10961](https://github.com/tiangolo/fastapi/pull/10961) by [@s111d](https://github.com/s111d).
From 76d0d81e70a70e663aba67d1631cb1fe030e1a45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hasan=20Sezer=20Ta=C5=9Fan?=
<13135006+hasansezertasan@users.noreply.github.com>
Date: Sun, 19 May 2024 02:43:13 +0300
Subject: [PATCH 027/366] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo:=20conv?=
=?UTF-8?q?ert=20every=20're-use'=20to=20'reuse'.=20(#11598)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/advanced/additional-responses.md | 2 +-
.../docs/advanced/path-operation-advanced-configuration.md | 2 +-
docs/en/docs/advanced/security/oauth2-scopes.md | 2 +-
docs/en/docs/advanced/settings.md | 2 +-
docs/en/docs/advanced/templates.md | 2 +-
docs/en/docs/deployment/docker.md | 4 ++--
docs/en/docs/how-to/custom-docs-ui-assets.md | 4 ++--
docs/en/docs/how-to/nosql-databases-couchbase.md | 2 +-
docs/en/docs/release-notes.md | 2 +-
docs/en/docs/tutorial/background-tasks.md | 2 +-
.../dependencies-in-path-operation-decorators.md | 2 +-
docs/en/docs/tutorial/dependencies/sub-dependencies.md | 2 +-
docs/en/docs/tutorial/handling-errors.md | 6 +++---
13 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/docs/en/docs/advanced/additional-responses.md b/docs/en/docs/advanced/additional-responses.md
index 41b39c18e..88d27018c 100644
--- a/docs/en/docs/advanced/additional-responses.md
+++ b/docs/en/docs/advanced/additional-responses.md
@@ -224,7 +224,7 @@ Here, `new_dict` will contain all the key-value pairs from `old_dict` plus the n
}
```
-You can use that technique to re-use some predefined responses in your *path operations* and combine them with additional custom ones.
+You can use that technique to reuse some predefined responses in your *path operations* and combine them with additional custom ones.
For example:
diff --git a/docs/en/docs/advanced/path-operation-advanced-configuration.md b/docs/en/docs/advanced/path-operation-advanced-configuration.md
index c5544a78b..35f7d1b8d 100644
--- a/docs/en/docs/advanced/path-operation-advanced-configuration.md
+++ b/docs/en/docs/advanced/path-operation-advanced-configuration.md
@@ -187,6 +187,6 @@ And then in our code, we parse that YAML content directly, and then we are again
In Pydantic version 1 the method to parse and validate an object was `Item.parse_obj()`, in Pydantic version 2, the method is called `Item.model_validate()`.
!!! tip
- Here we re-use the same Pydantic model.
+ Here we reuse the same Pydantic model.
But the same way, we could have validated it in some other way.
diff --git a/docs/en/docs/advanced/security/oauth2-scopes.md b/docs/en/docs/advanced/security/oauth2-scopes.md
index b93d2991c..728104865 100644
--- a/docs/en/docs/advanced/security/oauth2-scopes.md
+++ b/docs/en/docs/advanced/security/oauth2-scopes.md
@@ -361,7 +361,7 @@ It will have a property `scopes` with a list containing all the scopes required
The `security_scopes` object (of class `SecurityScopes`) also provides a `scope_str` attribute with a single string, containing those scopes separated by spaces (we are going to use it).
-We create an `HTTPException` that we can re-use (`raise`) later at several points.
+We create an `HTTPException` that we can reuse (`raise`) later at several points.
In this exception, we include the scopes required (if any) as a string separated by spaces (using `scope_str`). We put that string containing the scopes in the `WWW-Authenticate` header (this is part of the spec).
diff --git a/docs/en/docs/advanced/settings.md b/docs/en/docs/advanced/settings.md
index f9b525a58..56af4f441 100644
--- a/docs/en/docs/advanced/settings.md
+++ b/docs/en/docs/advanced/settings.md
@@ -369,7 +369,7 @@ Here we define the config `env_file` inside of your Pydantic `Settings` class, a
### Creating the `Settings` only once with `lru_cache`
-Reading a file from disk is normally a costly (slow) operation, so you probably want to do it only once and then re-use the same settings object, instead of reading it for each request.
+Reading a file from disk is normally a costly (slow) operation, so you probably want to do it only once and then reuse the same settings object, instead of reading it for each request.
But every time we do:
diff --git a/docs/en/docs/advanced/templates.md b/docs/en/docs/advanced/templates.md
index 6055b3017..4a577215a 100644
--- a/docs/en/docs/advanced/templates.md
+++ b/docs/en/docs/advanced/templates.md
@@ -23,7 +23,7 @@ $ pip install jinja2
## Using `Jinja2Templates`
* Import `Jinja2Templates`.
-* Create a `templates` object that you can re-use later.
+* Create a `templates` object that you can reuse later.
* Declare a `Request` parameter in the *path operation* that will return a template.
* Use the `templates` you created to render and return a `TemplateResponse`, pass the name of the template, the request object, and a "context" dictionary with key-value pairs to be used inside of the Jinja2 template.
diff --git a/docs/en/docs/deployment/docker.md b/docs/en/docs/deployment/docker.md
index 5181f77e0..5cd24eb46 100644
--- a/docs/en/docs/deployment/docker.md
+++ b/docs/en/docs/deployment/docker.md
@@ -70,7 +70,7 @@ And there are many other images for different things like databases, for example
By using a pre-made container image it's very easy to **combine** and use different tools. For example, to try out a new database. In most cases, you can use the **official images**, and just configure them with environment variables.
-That way, in many cases you can learn about containers and Docker and re-use that knowledge with many different tools and components.
+That way, in many cases you can learn about containers and Docker and reuse that knowledge with many different tools and components.
So, you would run **multiple containers** with different things, like a database, a Python application, a web server with a React frontend application, and connect them together via their internal network.
@@ -249,7 +249,7 @@ COPY ./requirements.txt /code/requirements.txt
Docker and other tools **build** these container images **incrementally**, adding **one layer on top of the other**, starting from the top of the `Dockerfile` and adding any files created by each of the instructions of the `Dockerfile`.
-Docker and similar tools also use an **internal cache** when building the image, if a file hasn't changed since the last time building the container image, then it will **re-use the same layer** created the last time, instead of copying the file again and creating a new layer from scratch.
+Docker and similar tools also use an **internal cache** when building the image, if a file hasn't changed since the last time building the container image, then it will **reuse the same layer** created the last time, instead of copying the file again and creating a new layer from scratch.
Just avoiding the copy of files doesn't necessarily improve things too much, but because it used the cache for that step, it can **use the cache for the next step**. For example, it could use the cache for the instruction that installs dependencies with:
diff --git a/docs/en/docs/how-to/custom-docs-ui-assets.md b/docs/en/docs/how-to/custom-docs-ui-assets.md
index 9726be2c7..adc1c1ef4 100644
--- a/docs/en/docs/how-to/custom-docs-ui-assets.md
+++ b/docs/en/docs/how-to/custom-docs-ui-assets.md
@@ -26,7 +26,7 @@ To disable them, set their URLs to `None` when creating your `FastAPI` app:
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:
+You can reuse 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.
@@ -163,7 +163,7 @@ To disable them, set their URLs to `None` when creating your `FastAPI` app:
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:
+Again, you can reuse 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.
diff --git a/docs/en/docs/how-to/nosql-databases-couchbase.md b/docs/en/docs/how-to/nosql-databases-couchbase.md
index 563318984..18e3f4b7e 100644
--- a/docs/en/docs/how-to/nosql-databases-couchbase.md
+++ b/docs/en/docs/how-to/nosql-databases-couchbase.md
@@ -108,7 +108,7 @@ Now create a function that will:
* Get the document with that ID.
* Put the contents of the document in a `UserInDB` model.
-By creating a function that is only dedicated to getting your user from a `username` (or any other parameter) independent of your *path operation function*, you can more easily re-use it in multiple parts and also add unit tests for it:
+By creating a function that is only dedicated to getting your user from a `username` (or any other parameter) independent of your *path operation function*, you can more easily reuse it in multiple parts and also add unit tests for it:
```Python hl_lines="36-42"
{!../../../docs_src/nosql_databases/tutorial001.py!}
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 58d15c494..b8201e9f8 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -3872,7 +3872,7 @@ Note: all the previous parameters are still there, so it's still possible to dec
* New documentation about exceptions handlers:
* [Install custom exception handlers](https://fastapi.tiangolo.com/tutorial/handling-errors/#install-custom-exception-handlers).
* [Override the default exception handlers](https://fastapi.tiangolo.com/tutorial/handling-errors/#override-the-default-exception-handlers).
- * [Re-use **FastAPI's** exception handlers](https://fastapi.tiangolo.com/tutorial/handling-errors/#re-use-fastapis-exception-handlers).
+ * [Reuse **FastAPI's** exception handlers](https://fastapi.tiangolo.com/tutorial/handling-errors/#reuse-fastapis-exception-handlers).
* PR [#273](https://github.com/tiangolo/fastapi/pull/273).
* Fix support for *paths* in *path parameters* without needing explicit `Path(...)`.
diff --git a/docs/en/docs/tutorial/background-tasks.md b/docs/en/docs/tutorial/background-tasks.md
index bc8e2af6a..bcfadc8b8 100644
--- a/docs/en/docs/tutorial/background-tasks.md
+++ b/docs/en/docs/tutorial/background-tasks.md
@@ -55,7 +55,7 @@ Inside of your *path operation function*, pass your task function to the *backgr
Using `BackgroundTasks` also works with the dependency injection system, you can declare a parameter of type `BackgroundTasks` at multiple levels: in a *path operation function*, in a dependency (dependable), in a sub-dependency, etc.
-**FastAPI** knows what to do in each case and how to re-use the same object, so that all the background tasks are merged together and are run in the background afterwards:
+**FastAPI** knows what to do in each case and how to reuse the same object, so that all the background tasks are merged together and are run in the background afterwards:
=== "Python 3.10+"
diff --git a/docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md b/docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
index eaab51d1b..082417f11 100644
--- a/docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
+++ b/docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
@@ -107,7 +107,7 @@ These dependencies can `raise` exceptions, the same as normal dependencies:
And they can return values or not, the values won't be used.
-So, you can re-use a normal dependency (that returns a value) you already use somewhere else, and even though the value won't be used, the dependency will be executed:
+So, you can reuse a normal dependency (that returns a value) you already use somewhere else, and even though the value won't be used, the dependency will be executed:
=== "Python 3.9+"
diff --git a/docs/en/docs/tutorial/dependencies/sub-dependencies.md b/docs/en/docs/tutorial/dependencies/sub-dependencies.md
index 1cb469a80..e5def9b7d 100644
--- a/docs/en/docs/tutorial/dependencies/sub-dependencies.md
+++ b/docs/en/docs/tutorial/dependencies/sub-dependencies.md
@@ -157,7 +157,7 @@ query_extractor --> query_or_cookie_extractor --> read_query
If one of your dependencies is declared multiple times for the same *path operation*, for example, multiple dependencies have a common sub-dependency, **FastAPI** will know to call that sub-dependency only once per request.
-And it will save the returned value in a "cache" and pass it to all the "dependants" that need it in that specific request, instead of calling the dependency multiple times for the same request.
+And it will save the returned value in a "cache" and pass it to all the "dependants" that need it in that specific request, instead of calling the dependency multiple times for the same request.
In an advanced scenario where you know you need the dependency to be called at every step (possibly multiple times) in the same request instead of using the "cached" value, you can set the parameter `use_cache=False` when using `Depends`:
diff --git a/docs/en/docs/tutorial/handling-errors.md b/docs/en/docs/tutorial/handling-errors.md
index 98ac55d1f..6133898e4 100644
--- a/docs/en/docs/tutorial/handling-errors.md
+++ b/docs/en/docs/tutorial/handling-errors.md
@@ -248,12 +248,12 @@ In this example, to be able to have both `HTTPException`s in the same code, Star
from starlette.exceptions import HTTPException as StarletteHTTPException
```
-### Re-use **FastAPI**'s exception handlers
+### Reuse **FastAPI**'s exception handlers
-If you want to use the exception along with the same default exception handlers from **FastAPI**, You can import and re-use the default exception handlers from `fastapi.exception_handlers`:
+If you want to use the exception along with the same default exception handlers from **FastAPI**, You can import and reuse the default exception handlers from `fastapi.exception_handlers`:
```Python hl_lines="2-5 15 21"
{!../../../docs_src/handling_errors/tutorial006.py!}
```
-In this example you are just `print`ing the error with a very expressive message, but you get the idea. You can use the exception and then just re-use the default exception handlers.
+In this example you are just `print`ing the error with a very expressive message, but you get the idea. You can use the exception and then just reuse the default exception handlers.
From ca321db5dbcd53de77cca9d4ccb26dcb88f337b3 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Sat, 18 May 2024 23:43:36 +0000
Subject: [PATCH 028/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index b8201e9f8..fdad0494d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -11,6 +11,7 @@ hide:
### Docs
+* ✏️ Fix typo: convert every 're-use' to 'reuse'.. PR [#11598](https://github.com/tiangolo/fastapi/pull/11598) by [@hasansezertasan](https://github.com/hasansezertasan).
* ✏️ Fix typo in `fastapi/applications.py`. PR [#11593](https://github.com/tiangolo/fastapi/pull/11593) by [@petarmaric](https://github.com/petarmaric).
* ✏️ Fix link in `fastapi-cli.md`. PR [#11524](https://github.com/tiangolo/fastapi/pull/11524) by [@svlandeg](https://github.com/svlandeg).
From 651dd00a9e3bc75fd872737cb0fbc3a0f44b9e38 Mon Sep 17 00:00:00 2001
From: Alejandra <90076947+alejsdev@users.noreply.github.com>
Date: Sun, 19 May 2024 19:24:48 -0500
Subject: [PATCH 029/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20docs=20(#11603)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
docs/en/docs/async.md | 2 +-
docs/en/docs/tutorial/first-steps.md | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/en/docs/async.md b/docs/en/docs/async.md
index a0c00933a..793d691e3 100644
--- a/docs/en/docs/async.md
+++ b/docs/en/docs/async.md
@@ -222,7 +222,7 @@ All of the cashiers doing all the work with one client after the other 👨
And you have to wait 🕙 in the line for a long time or you lose your turn.
-You probably wouldn't want to take your crush 😍 with you to do errands at the bank 🏦.
+You probably wouldn't want to take your crush 😍 with you to run errands at the bank 🏦.
### Burger Conclusion
diff --git a/docs/en/docs/tutorial/first-steps.md b/docs/en/docs/tutorial/first-steps.md
index 35b2feb41..d18b25d97 100644
--- a/docs/en/docs/tutorial/first-steps.md
+++ b/docs/en/docs/tutorial/first-steps.md
@@ -325,6 +325,6 @@ There are many other objects and models that will be automatically converted to
* Import `FastAPI`.
* Create an `app` instance.
-* Write a **path operation decorator** (like `@app.get("/")`).
-* Write a **path operation function** (like `def root(): ...` above).
-* Run the development server (like `uvicorn main:app --reload`).
+* Write a **path operation decorator** using decorators like `@app.get("/")`.
+* Define a **path operation function**; for example, `def root(): ...`.
+* Run the development server using the command `fastapi dev`.
From 710b320fd0e441fcf1f25b584d7ec50b36d04df0 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Mon, 20 May 2024 00:25:11 +0000
Subject: [PATCH 030/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index fdad0494d..048020c8c 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -11,6 +11,7 @@ hide:
### Docs
+* 📝 Update docs. PR [#11603](https://github.com/tiangolo/fastapi/pull/11603) by [@alejsdev](https://github.com/alejsdev).
* ✏️ Fix typo: convert every 're-use' to 'reuse'.. PR [#11598](https://github.com/tiangolo/fastapi/pull/11598) by [@hasansezertasan](https://github.com/hasansezertasan).
* ✏️ Fix typo in `fastapi/applications.py`. PR [#11593](https://github.com/tiangolo/fastapi/pull/11593) by [@petarmaric](https://github.com/petarmaric).
* ✏️ Fix link in `fastapi-cli.md`. PR [#11524](https://github.com/tiangolo/fastapi/pull/11524) by [@svlandeg](https://github.com/svlandeg).
From 5fa8e38681b1f3e835991159d27bf0a3a76308f7 Mon Sep 17 00:00:00 2001
From: Esteban Maya
Date: Mon, 20 May 2024 12:37:28 -0500
Subject: [PATCH 031/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20JWT=20auth=20do?=
=?UTF-8?q?cumentation=20to=20use=20PyJWT=20instead=20of=20pyhon-jose=20(#?=
=?UTF-8?q?11589)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez
---
.../docs/advanced/security/oauth2-scopes.md | 96 +++++++++----------
docs/en/docs/tutorial/security/oauth2-jwt.md | 58 ++++++-----
docs_src/security/tutorial004.py | 5 +-
docs_src/security/tutorial004_an.py | 5 +-
docs_src/security/tutorial004_an_py310.py | 5 +-
docs_src/security/tutorial004_an_py39.py | 5 +-
docs_src/security/tutorial004_py310.py | 5 +-
docs_src/security/tutorial005.py | 5 +-
docs_src/security/tutorial005_an.py | 5 +-
docs_src/security/tutorial005_an_py310.py | 5 +-
docs_src/security/tutorial005_an_py39.py | 5 +-
docs_src/security/tutorial005_py310.py | 5 +-
docs_src/security/tutorial005_py39.py | 5 +-
requirements-tests.txt | 2 +-
14 files changed, 109 insertions(+), 102 deletions(-)
diff --git a/docs/en/docs/advanced/security/oauth2-scopes.md b/docs/en/docs/advanced/security/oauth2-scopes.md
index 728104865..9a9c0dff9 100644
--- a/docs/en/docs/advanced/security/oauth2-scopes.md
+++ b/docs/en/docs/advanced/security/oauth2-scopes.md
@@ -58,19 +58,19 @@ First, let's quickly see the parts that change from the examples in the main **T
=== "Python 3.10+"
- ```Python hl_lines="4 8 12 46 64 105 107-115 121-124 128-134 139 155"
+ ```Python hl_lines="5 9 13 47 65 106 108-116 122-125 129-135 140 156"
{!> ../../../docs_src/security/tutorial005_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
+ ```Python hl_lines="2 5 9 13 47 65 106 108-116 122-125 129-135 140 156"
{!> ../../../docs_src/security/tutorial005_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="2 4 8 12 47 65 106 108-116 122-125 129-135 140 156"
+ ```Python hl_lines="2 5 9 13 48 66 107 109-117 123-126 130-136 141 157"
{!> ../../../docs_src/security/tutorial005_an.py!}
```
@@ -79,7 +79,7 @@ First, let's quickly see the parts that change from the examples in the main **T
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="3 7 11 45 63 104 106-114 120-123 127-133 138 154"
+ ```Python hl_lines="4 8 12 46 64 105 107-115 121-124 128-134 139 155"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -88,7 +88,7 @@ First, let's quickly see the parts that change from the examples in the main **T
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
+ ```Python hl_lines="2 5 9 13 47 65 106 108-116 122-125 129-135 140 156"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -97,7 +97,7 @@ First, let's quickly see the parts that change from the examples in the main **T
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
+ ```Python hl_lines="2 5 9 13 47 65 106 108-116 122-125 129-135 140 156"
{!> ../../../docs_src/security/tutorial005.py!}
```
@@ -111,19 +111,19 @@ The `scopes` parameter receives a `dict` with each scope as a key and the descri
=== "Python 3.10+"
- ```Python hl_lines="62-65"
+ ```Python hl_lines="63-66"
{!> ../../../docs_src/security/tutorial005_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="62-65"
+ ```Python hl_lines="63-66"
{!> ../../../docs_src/security/tutorial005_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="63-66"
+ ```Python hl_lines="64-67"
{!> ../../../docs_src/security/tutorial005_an.py!}
```
@@ -132,7 +132,7 @@ The `scopes` parameter receives a `dict` with each scope as a key and the descri
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="61-64"
+ ```Python hl_lines="62-65"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -142,7 +142,7 @@ The `scopes` parameter receives a `dict` with each scope as a key and the descri
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="62-65"
+ ```Python hl_lines="63-66"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -151,7 +151,7 @@ The `scopes` parameter receives a `dict` with each scope as a key and the descri
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="62-65"
+ ```Python hl_lines="63-66"
{!> ../../../docs_src/security/tutorial005.py!}
```
@@ -178,19 +178,19 @@ And we return the scopes as part of the JWT token.
=== "Python 3.10+"
- ```Python hl_lines="155"
+ ```Python hl_lines="156"
{!> ../../../docs_src/security/tutorial005_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="155"
+ ```Python hl_lines="156"
{!> ../../../docs_src/security/tutorial005_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="156"
+ ```Python hl_lines="157"
{!> ../../../docs_src/security/tutorial005_an.py!}
```
@@ -199,7 +199,7 @@ And we return the scopes as part of the JWT token.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="154"
+ ```Python hl_lines="155"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -208,7 +208,7 @@ And we return the scopes as part of the JWT token.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="155"
+ ```Python hl_lines="156"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -217,7 +217,7 @@ And we return the scopes as part of the JWT token.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="155"
+ ```Python hl_lines="156"
{!> ../../../docs_src/security/tutorial005.py!}
```
@@ -244,19 +244,19 @@ In this case, it requires the scope `me` (it could require more than one scope).
=== "Python 3.10+"
- ```Python hl_lines="4 139 170"
+ ```Python hl_lines="5 140 171"
{!> ../../../docs_src/security/tutorial005_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="4 139 170"
+ ```Python hl_lines="5 140 171"
{!> ../../../docs_src/security/tutorial005_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="4 140 171"
+ ```Python hl_lines="5 141 172"
{!> ../../../docs_src/security/tutorial005_an.py!}
```
@@ -265,7 +265,7 @@ In this case, it requires the scope `me` (it could require more than one scope).
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="3 138 167"
+ ```Python hl_lines="4 139 168"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -274,7 +274,7 @@ In this case, it requires the scope `me` (it could require more than one scope).
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="4 139 168"
+ ```Python hl_lines="5 140 169"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -283,7 +283,7 @@ In this case, it requires the scope `me` (it could require more than one scope).
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="4 139 168"
+ ```Python hl_lines="5 140 169"
{!> ../../../docs_src/security/tutorial005.py!}
```
@@ -310,19 +310,19 @@ This `SecurityScopes` class is similar to `Request` (`Request` was used to get t
=== "Python 3.10+"
- ```Python hl_lines="8 105"
+ ```Python hl_lines="9 106"
{!> ../../../docs_src/security/tutorial005_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="8 105"
+ ```Python hl_lines="9 106"
{!> ../../../docs_src/security/tutorial005_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="8 106"
+ ```Python hl_lines="9 107"
{!> ../../../docs_src/security/tutorial005_an.py!}
```
@@ -331,7 +331,7 @@ This `SecurityScopes` class is similar to `Request` (`Request` was used to get t
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="7 104"
+ ```Python hl_lines="8 105"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -340,7 +340,7 @@ This `SecurityScopes` class is similar to `Request` (`Request` was used to get t
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="8 105"
+ ```Python hl_lines="9 106"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -349,7 +349,7 @@ This `SecurityScopes` class is similar to `Request` (`Request` was used to get t
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="8 105"
+ ```Python hl_lines="9 106"
{!> ../../../docs_src/security/tutorial005.py!}
```
@@ -367,19 +367,19 @@ In this exception, we include the scopes required (if any) as a string separated
=== "Python 3.10+"
- ```Python hl_lines="105 107-115"
+ ```Python hl_lines="106 108-116"
{!> ../../../docs_src/security/tutorial005_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="105 107-115"
+ ```Python hl_lines="106 108-116"
{!> ../../../docs_src/security/tutorial005_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="106 108-116"
+ ```Python hl_lines="107 109-117"
{!> ../../../docs_src/security/tutorial005_an.py!}
```
@@ -388,7 +388,7 @@ In this exception, we include the scopes required (if any) as a string separated
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="104 106-114"
+ ```Python hl_lines="105 107-115"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -397,7 +397,7 @@ In this exception, we include the scopes required (if any) as a string separated
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="105 107-115"
+ ```Python hl_lines="106 108-116"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -406,7 +406,7 @@ In this exception, we include the scopes required (if any) as a string separated
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="105 107-115"
+ ```Python hl_lines="106 108-116"
{!> ../../../docs_src/security/tutorial005.py!}
```
@@ -426,19 +426,19 @@ We also verify that we have a user with that username, and if not, we raise that
=== "Python 3.10+"
- ```Python hl_lines="46 116-127"
+ ```Python hl_lines="47 117-128"
{!> ../../../docs_src/security/tutorial005_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="46 116-127"
+ ```Python hl_lines="47 117-128"
{!> ../../../docs_src/security/tutorial005_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="47 117-128"
+ ```Python hl_lines="48 118-129"
{!> ../../../docs_src/security/tutorial005_an.py!}
```
@@ -447,7 +447,7 @@ We also verify that we have a user with that username, and if not, we raise that
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="45 115-126"
+ ```Python hl_lines="46 116-127"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -456,7 +456,7 @@ We also verify that we have a user with that username, and if not, we raise that
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="46 116-127"
+ ```Python hl_lines="47 117-128"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -465,7 +465,7 @@ We also verify that we have a user with that username, and if not, we raise that
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="46 116-127"
+ ```Python hl_lines="47 117-128"
{!> ../../../docs_src/security/tutorial005.py!}
```
@@ -477,19 +477,19 @@ For this, we use `security_scopes.scopes`, that contains a `list` with all these
=== "Python 3.10+"
- ```Python hl_lines="128-134"
+ ```Python hl_lines="129-135"
{!> ../../../docs_src/security/tutorial005_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="128-134"
+ ```Python hl_lines="129-135"
{!> ../../../docs_src/security/tutorial005_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="129-135"
+ ```Python hl_lines="130-136"
{!> ../../../docs_src/security/tutorial005_an.py!}
```
@@ -498,7 +498,7 @@ For this, we use `security_scopes.scopes`, that contains a `list` with all these
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="127-133"
+ ```Python hl_lines="128-134"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -507,7 +507,7 @@ For this, we use `security_scopes.scopes`, that contains a `list` with all these
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="128-134"
+ ```Python hl_lines="129-135"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -516,7 +516,7 @@ For this, we use `security_scopes.scopes`, that contains a `list` with all these
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="128-134"
+ ```Python hl_lines="129-135"
{!> ../../../docs_src/security/tutorial005.py!}
```
diff --git a/docs/en/docs/tutorial/security/oauth2-jwt.md b/docs/en/docs/tutorial/security/oauth2-jwt.md
index b02d00c3f..b011db67a 100644
--- a/docs/en/docs/tutorial/security/oauth2-jwt.md
+++ b/docs/en/docs/tutorial/security/oauth2-jwt.md
@@ -26,28 +26,24 @@ After a week, the token will be expired and the user will not be authorized and
If you want to play with JWT tokens and see how they work, check https://jwt.io.
-## Install `python-jose`
+## Install `PyJWT`
-We need to install `python-jose` to generate and verify the JWT tokens in Python:
+We need to install `PyJWT` to generate and verify the JWT tokens in Python:
```console
-$ pip install "python-jose[cryptography]"
+$ pip install pyjwt
---> 100%
```
-Python-jose requires a cryptographic backend as an extra.
+!!! info
+ If you are planning to use digital signature algorithms like RSA or ECDSA, you should install the cryptography library dependency `pyjwt[crypto]`.
-Here we are using the recommended one: pyca/cryptography.
-
-!!! tip
- This tutorial previously used PyJWT.
-
- But it was updated to use Python-jose instead as it provides all the features from PyJWT plus some extras that you might need later when building integrations with other tools.
+ You can read more about it in the PyJWT Installation docs.
## Password hashing
@@ -111,19 +107,19 @@ And another one to authenticate and return a user.
=== "Python 3.10+"
- ```Python hl_lines="7 48 55-56 59-60 69-75"
+ ```Python hl_lines="8 49 56-57 60-61 70-76"
{!> ../../../docs_src/security/tutorial004_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="7 48 55-56 59-60 69-75"
+ ```Python hl_lines="8 49 56-57 60-61 70-76"
{!> ../../../docs_src/security/tutorial004_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="7 49 56-57 60-61 70-76"
+ ```Python hl_lines="8 50 57-58 61-62 71-77"
{!> ../../../docs_src/security/tutorial004_an.py!}
```
@@ -132,7 +128,7 @@ And another one to authenticate and return a user.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="6 47 54-55 58-59 68-74"
+ ```Python hl_lines="7 48 55-56 59-60 69-75"
{!> ../../../docs_src/security/tutorial004_py310.py!}
```
@@ -141,7 +137,7 @@ And another one to authenticate and return a user.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="7 48 55-56 59-60 69-75"
+ ```Python hl_lines="8 49 56-57 60-61 70-76"
{!> ../../../docs_src/security/tutorial004.py!}
```
@@ -178,19 +174,19 @@ Create a utility function to generate a new access token.
=== "Python 3.10+"
- ```Python hl_lines="6 12-14 28-30 78-86"
+ ```Python hl_lines="4 7 13-15 29-31 79-87"
{!> ../../../docs_src/security/tutorial004_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="6 12-14 28-30 78-86"
+ ```Python hl_lines="4 7 13-15 29-31 79-87"
{!> ../../../docs_src/security/tutorial004_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="6 13-15 29-31 79-87"
+ ```Python hl_lines="4 7 14-16 30-32 80-88"
{!> ../../../docs_src/security/tutorial004_an.py!}
```
@@ -199,7 +195,7 @@ Create a utility function to generate a new access token.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="5 11-13 27-29 77-85"
+ ```Python hl_lines="3 6 12-14 28-30 78-86"
{!> ../../../docs_src/security/tutorial004_py310.py!}
```
@@ -208,7 +204,7 @@ Create a utility function to generate a new access token.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="6 12-14 28-30 78-86"
+ ```Python hl_lines="4 7 13-15 29-31 79-87"
{!> ../../../docs_src/security/tutorial004.py!}
```
@@ -222,19 +218,19 @@ If the token is invalid, return an HTTP error right away.
=== "Python 3.10+"
- ```Python hl_lines="89-106"
+ ```Python hl_lines="90-107"
{!> ../../../docs_src/security/tutorial004_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="89-106"
+ ```Python hl_lines="90-107"
{!> ../../../docs_src/security/tutorial004_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="90-107"
+ ```Python hl_lines="91-108"
{!> ../../../docs_src/security/tutorial004_an.py!}
```
@@ -243,7 +239,7 @@ If the token is invalid, return an HTTP error right away.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="88-105"
+ ```Python hl_lines="89-106"
{!> ../../../docs_src/security/tutorial004_py310.py!}
```
@@ -252,7 +248,7 @@ If the token is invalid, return an HTTP error right away.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="89-106"
+ ```Python hl_lines="90-107"
{!> ../../../docs_src/security/tutorial004.py!}
```
@@ -264,19 +260,19 @@ Create a real JWT access token and return it.
=== "Python 3.10+"
- ```Python hl_lines="117-132"
+ ```Python hl_lines="118-133"
{!> ../../../docs_src/security/tutorial004_an_py310.py!}
```
=== "Python 3.9+"
- ```Python hl_lines="117-132"
+ ```Python hl_lines="118-133"
{!> ../../../docs_src/security/tutorial004_an_py39.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="118-133"
+ ```Python hl_lines="119-134"
{!> ../../../docs_src/security/tutorial004_an.py!}
```
@@ -285,7 +281,7 @@ Create a real JWT access token and return it.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="114-129"
+ ```Python hl_lines="115-130"
{!> ../../../docs_src/security/tutorial004_py310.py!}
```
@@ -294,7 +290,7 @@ Create a real JWT access token and return it.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="115-130"
+ ```Python hl_lines="116-131"
{!> ../../../docs_src/security/tutorial004.py!}
```
@@ -384,7 +380,7 @@ Many packages that simplify it a lot have to make many compromises with the data
It gives you all the flexibility to choose the ones that fit your project the best.
-And you can use directly many well maintained and widely used packages like `passlib` and `python-jose`, because **FastAPI** doesn't require any complex mechanisms to integrate external packages.
+And you can use directly many well maintained and widely used packages like `passlib` and `PyJWT`, because **FastAPI** doesn't require any complex mechanisms to integrate external packages.
But it provides you the tools to simplify the process as much as possible without compromising flexibility, robustness, or security.
diff --git a/docs_src/security/tutorial004.py b/docs_src/security/tutorial004.py
index d0fbaa572..91d161b8a 100644
--- a/docs_src/security/tutorial004.py
+++ b/docs_src/security/tutorial004.py
@@ -1,9 +1,10 @@
from datetime import datetime, timedelta, timezone
from typing import Union
+import jwt
from fastapi import Depends, FastAPI, HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel
@@ -98,7 +99,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme)):
if username is None:
raise credentials_exception
token_data = TokenData(username=username)
- except JWTError:
+ except InvalidTokenError:
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial004_an.py b/docs_src/security/tutorial004_an.py
index eebd36d64..df50754af 100644
--- a/docs_src/security/tutorial004_an.py
+++ b/docs_src/security/tutorial004_an.py
@@ -1,9 +1,10 @@
from datetime import datetime, timedelta, timezone
from typing import Union
+import jwt
from fastapi import Depends, FastAPI, HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel
from typing_extensions import Annotated
@@ -99,7 +100,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
if username is None:
raise credentials_exception
token_data = TokenData(username=username)
- except JWTError:
+ except InvalidTokenError:
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial004_an_py310.py b/docs_src/security/tutorial004_an_py310.py
index 4e50ada7c..eff54ef01 100644
--- a/docs_src/security/tutorial004_an_py310.py
+++ b/docs_src/security/tutorial004_an_py310.py
@@ -1,9 +1,10 @@
from datetime import datetime, timedelta, timezone
from typing import Annotated
+import jwt
from fastapi import Depends, FastAPI, HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel
@@ -98,7 +99,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
if username is None:
raise credentials_exception
token_data = TokenData(username=username)
- except JWTError:
+ except InvalidTokenError:
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial004_an_py39.py b/docs_src/security/tutorial004_an_py39.py
index eb49aaa67..0455b500c 100644
--- a/docs_src/security/tutorial004_an_py39.py
+++ b/docs_src/security/tutorial004_an_py39.py
@@ -1,9 +1,10 @@
from datetime import datetime, timedelta, timezone
from typing import Annotated, Union
+import jwt
from fastapi import Depends, FastAPI, HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel
@@ -98,7 +99,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
if username is None:
raise credentials_exception
token_data = TokenData(username=username)
- except JWTError:
+ except InvalidTokenError:
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial004_py310.py b/docs_src/security/tutorial004_py310.py
index 5a905783d..78bee22a3 100644
--- a/docs_src/security/tutorial004_py310.py
+++ b/docs_src/security/tutorial004_py310.py
@@ -1,8 +1,9 @@
from datetime import datetime, timedelta, timezone
+import jwt
from fastapi import Depends, FastAPI, HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel
@@ -97,7 +98,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme)):
if username is None:
raise credentials_exception
token_data = TokenData(username=username)
- except JWTError:
+ except InvalidTokenError:
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial005.py b/docs_src/security/tutorial005.py
index d4a6975da..ccad07969 100644
--- a/docs_src/security/tutorial005.py
+++ b/docs_src/security/tutorial005.py
@@ -1,13 +1,14 @@
from datetime import datetime, timedelta, timezone
from typing import List, Union
+import jwt
from fastapi import Depends, FastAPI, HTTPException, Security, status
from fastapi.security import (
OAuth2PasswordBearer,
OAuth2PasswordRequestForm,
SecurityScopes,
)
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel, ValidationError
@@ -120,7 +121,7 @@ async def get_current_user(
raise credentials_exception
token_scopes = payload.get("scopes", [])
token_data = TokenData(scopes=token_scopes, username=username)
- except (JWTError, ValidationError):
+ except (InvalidTokenError, ValidationError):
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial005_an.py b/docs_src/security/tutorial005_an.py
index 982daed2f..5b67cb145 100644
--- a/docs_src/security/tutorial005_an.py
+++ b/docs_src/security/tutorial005_an.py
@@ -1,13 +1,14 @@
from datetime import datetime, timedelta, timezone
from typing import List, Union
+import jwt
from fastapi import Depends, FastAPI, HTTPException, Security, status
from fastapi.security import (
OAuth2PasswordBearer,
OAuth2PasswordRequestForm,
SecurityScopes,
)
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel, ValidationError
from typing_extensions import Annotated
@@ -121,7 +122,7 @@ async def get_current_user(
raise credentials_exception
token_scopes = payload.get("scopes", [])
token_data = TokenData(scopes=token_scopes, username=username)
- except (JWTError, ValidationError):
+ except (InvalidTokenError, ValidationError):
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial005_an_py310.py b/docs_src/security/tutorial005_an_py310.py
index 79aafbff1..297193e35 100644
--- a/docs_src/security/tutorial005_an_py310.py
+++ b/docs_src/security/tutorial005_an_py310.py
@@ -1,13 +1,14 @@
from datetime import datetime, timedelta, timezone
from typing import Annotated
+import jwt
from fastapi import Depends, FastAPI, HTTPException, Security, status
from fastapi.security import (
OAuth2PasswordBearer,
OAuth2PasswordRequestForm,
SecurityScopes,
)
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel, ValidationError
@@ -120,7 +121,7 @@ async def get_current_user(
raise credentials_exception
token_scopes = payload.get("scopes", [])
token_data = TokenData(scopes=token_scopes, username=username)
- except (JWTError, ValidationError):
+ except (InvalidTokenError, ValidationError):
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial005_an_py39.py b/docs_src/security/tutorial005_an_py39.py
index 3bdab5507..1acf47bdc 100644
--- a/docs_src/security/tutorial005_an_py39.py
+++ b/docs_src/security/tutorial005_an_py39.py
@@ -1,13 +1,14 @@
from datetime import datetime, timedelta, timezone
from typing import Annotated, List, Union
+import jwt
from fastapi import Depends, FastAPI, HTTPException, Security, status
from fastapi.security import (
OAuth2PasswordBearer,
OAuth2PasswordRequestForm,
SecurityScopes,
)
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel, ValidationError
@@ -120,7 +121,7 @@ async def get_current_user(
raise credentials_exception
token_scopes = payload.get("scopes", [])
token_data = TokenData(scopes=token_scopes, username=username)
- except (JWTError, ValidationError):
+ except (InvalidTokenError, ValidationError):
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial005_py310.py b/docs_src/security/tutorial005_py310.py
index 9f75aa0be..b244ef08e 100644
--- a/docs_src/security/tutorial005_py310.py
+++ b/docs_src/security/tutorial005_py310.py
@@ -1,12 +1,13 @@
from datetime import datetime, timedelta, timezone
+import jwt
from fastapi import Depends, FastAPI, HTTPException, Security, status
from fastapi.security import (
OAuth2PasswordBearer,
OAuth2PasswordRequestForm,
SecurityScopes,
)
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel, ValidationError
@@ -119,7 +120,7 @@ async def get_current_user(
raise credentials_exception
token_scopes = payload.get("scopes", [])
token_data = TokenData(scopes=token_scopes, username=username)
- except (JWTError, ValidationError):
+ except (InvalidTokenError, ValidationError):
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/docs_src/security/tutorial005_py39.py b/docs_src/security/tutorial005_py39.py
index bac248932..8f0e93376 100644
--- a/docs_src/security/tutorial005_py39.py
+++ b/docs_src/security/tutorial005_py39.py
@@ -1,13 +1,14 @@
from datetime import datetime, timedelta, timezone
from typing import Union
+import jwt
from fastapi import Depends, FastAPI, HTTPException, Security, status
from fastapi.security import (
OAuth2PasswordBearer,
OAuth2PasswordRequestForm,
SecurityScopes,
)
-from jose import JWTError, jwt
+from jwt.exceptions import InvalidTokenError
from passlib.context import CryptContext
from pydantic import BaseModel, ValidationError
@@ -120,7 +121,7 @@ async def get_current_user(
raise credentials_exception
token_scopes = payload.get("scopes", [])
token_data = TokenData(scopes=token_scopes, username=username)
- except (JWTError, ValidationError):
+ except (InvalidTokenError, ValidationError):
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
diff --git a/requirements-tests.txt b/requirements-tests.txt
index 88a553330..bfe70f2f5 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -11,7 +11,7 @@ sqlalchemy >=1.3.18,<1.4.43
databases[sqlite] >=0.3.2,<0.7.0
flask >=1.1.2,<3.0.0
anyio[trio] >=3.2.1,<4.0.0
-python-jose[cryptography] >=3.3.0,<4.0.0
+PyJWT==2.8.0
pyyaml >=5.3.1,<7.0.0
passlib[bcrypt] >=1.7.2,<2.0.0
From bfe698c667aeaaefb52a59657f8901502ff6ba54 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Mon, 20 May 2024 17:37:51 +0000
Subject: [PATCH 032/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 048020c8c..2232887ac 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -11,6 +11,7 @@ hide:
### Docs
+* 📝 Update JWT auth documentation to use PyJWT instead of pyhon-jose. PR [#11589](https://github.com/tiangolo/fastapi/pull/11589) by [@estebanx64](https://github.com/estebanx64).
* 📝 Update docs. PR [#11603](https://github.com/tiangolo/fastapi/pull/11603) by [@alejsdev](https://github.com/alejsdev).
* ✏️ Fix typo: convert every 're-use' to 'reuse'.. PR [#11598](https://github.com/tiangolo/fastapi/pull/11598) by [@hasansezertasan](https://github.com/hasansezertasan).
* ✏️ Fix typo in `fastapi/applications.py`. PR [#11593](https://github.com/tiangolo/fastapi/pull/11593) by [@petarmaric](https://github.com/petarmaric).
From a4c4eb2964f163a87d3ba887b1a6714ffbe36941 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hasan=20Sezer=20Ta=C5=9Fan?=
<13135006+hasansezertasan@users.noreply.github.com>
Date: Tue, 21 May 2024 02:57:08 +0300
Subject: [PATCH 033/366] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translat?=
=?UTF-8?q?ion=20for=20`docs/tr/docs/tutorial/static-files.md`=20(#11599)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/tr/docs/tutorial/static-files.md | 39 +++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 docs/tr/docs/tutorial/static-files.md
diff --git a/docs/tr/docs/tutorial/static-files.md b/docs/tr/docs/tutorial/static-files.md
new file mode 100644
index 000000000..00c833686
--- /dev/null
+++ b/docs/tr/docs/tutorial/static-files.md
@@ -0,0 +1,39 @@
+# Statik Dosyalar
+
+`StaticFiles`'ı kullanarak statik dosyaları bir yol altında sunabilirsiniz.
+
+## `StaticFiles` Kullanımı
+
+* `StaticFiles` sınıfını projenize dahil edin.
+* Bir `StaticFiles()` örneğini belirli bir yola bağlayın.
+
+```Python hl_lines="2 6"
+{!../../../docs_src/static_files/tutorial001.py!}
+```
+
+!!! note "Teknik Detaylar"
+ Projenize dahil etmek için `from starlette.staticfiles import StaticFiles` kullanabilirsiniz.
+
+ **FastAPI**, geliştiricilere kolaylık sağlamak amacıyla `starlette.staticfiles`'ı `fastapi.staticfiles` olarak sağlar. Ancak `StaticFiles` sınıfı aslında doğrudan Starlette'den gelir.
+
+### Bağlama (Mounting) Nedir?
+
+"Bağlamak", belirli bir yola tamamen "bağımsız" bir uygulama eklemek anlamına gelir ve ardından tüm alt yollara gelen istekler bu uygulama tarafından işlenir.
+
+Bu, bir `APIRouter` kullanmaktan farklıdır çünkü bağlanmış bir uygulama tamamen bağımsızdır. Ana uygulamanızın OpenAPI ve dokümanlar, bağlanmış uygulamadan hiçbir şey içermez, vb.
+
+[Advanced User Guide](../advanced/index.md){.internal-link target=_blank} bölümünde daha fazla bilgi edinebilirsiniz.
+
+## Detaylar
+
+`"/static"` ifadesi, bu "alt uygulamanın" "bağlanacağı" alt yolu belirtir. Bu nedenle, `"/static"` ile başlayan her yol, bu uygulama tarafından işlenir.
+
+`directory="static"` ifadesi, statik dosyalarınızı içeren dizinin adını belirtir.
+
+`name="static"` ifadesi, alt uygulamanın **FastAPI** tarafından kullanılacak ismini belirtir.
+
+Bu parametrelerin hepsi "`static`"den farklı olabilir, bunları kendi uygulamanızın ihtiyaçlarına göre belirleyebilirsiniz.
+
+## Daha Fazla Bilgi
+
+Daha fazla detay ve seçenek için Starlette'in Statik Dosyalar hakkındaki dokümantasyonunu incelleyin.
From 3e6a59183bd4feb094d8e37439e0b886c360e068 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Mon, 20 May 2024 23:57:31 +0000
Subject: [PATCH 034/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 2232887ac..ba6cc8b5a 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -19,6 +19,7 @@ hide:
### Translations
+* 🌐 Add Turkish translation for `docs/tr/docs/tutorial/static-files.md`. PR [#11599](https://github.com/tiangolo/fastapi/pull/11599) by [@hasansezertasan](https://github.com/hasansezertasan).
* 🌐 Polish translation for `docs/pl/docs/fastapi-people.md`. PR [#10196](https://github.com/tiangolo/fastapi/pull/10196) by [@isulim](https://github.com/isulim).
* 🌐 Add Turkish translation for `docs/tr/docs/advanced/wsgi.md`. PR [#11575](https://github.com/tiangolo/fastapi/pull/11575) by [@hasansezertasan](https://github.com/hasansezertasan).
* 🌐 Add Turkish translation for `docs/tr/docs/tutorial/cookie-params.md`. PR [#11561](https://github.com/tiangolo/fastapi/pull/11561) by [@hasansezertasan](https://github.com/hasansezertasan).
From f1ab5300a7fa32f37ca9ff70627078ebb6f04b2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hasan=20Sezer=20Ta=C5=9Fan?=
<13135006+hasansezertasan@users.noreply.github.com>
Date: Fri, 24 May 2024 01:46:42 +0300
Subject: [PATCH 035/366] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translat?=
=?UTF-8?q?ion=20for=20`docs/tr/docs/deployment/index.md`=20(#11605)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/tr/docs/deployment/index.md | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 docs/tr/docs/deployment/index.md
diff --git a/docs/tr/docs/deployment/index.md b/docs/tr/docs/deployment/index.md
new file mode 100644
index 000000000..e03bb4ee0
--- /dev/null
+++ b/docs/tr/docs/deployment/index.md
@@ -0,0 +1,21 @@
+# Deployment (Yayınlama)
+
+**FastAPI** uygulamasını deploy etmek oldukça kolaydır.
+
+## Deployment Ne Anlama Gelir?
+
+Bir uygulamayı **deploy** etmek (yayınlamak), uygulamayı **kullanıcılara erişilebilir hale getirmek** için gerekli adımları gerçekleştirmek anlamına gelir.
+
+Bir **Web API** için bu süreç normalde uygulamayı **uzak bir makineye** yerleştirmeyi, iyi performans, kararlılık vb. özellikler sağlayan bir **sunucu programı** ile **kullanıcılarınızın** uygulamaya etkili ve kesintisiz bir şekilde **erişebilmesini** kapsar.
+
+Bu, kodu sürekli olarak değiştirdiğiniz, hata alıp hata giderdiğiniz, geliştirme sunucusunu durdurup yeniden başlattığınız vb. **geliştirme** aşamalarının tam tersidir.
+
+## Deployment Stratejileri
+
+Kullanım durumunuza ve kullandığınız araçlara bağlı olarak bir kaç farklı yol izleyebilirsiniz.
+
+Bir dizi araç kombinasyonunu kullanarak kendiniz **bir sunucu yayınlayabilirsiniz**, yayınlama sürecinin bir kısmını sizin için gerçekleştiren bir **bulut hizmeti** veya diğer olası seçenekleri kullanabilirsiniz.
+
+**FastAPI** uygulamasını yayınlarken aklınızda bulundurmanız gereken ana kavramlardan bazılarını size göstereceğim (ancak bunların çoğu diğer web uygulamaları için de geçerlidir).
+
+Sonraki bölümlerde akılda tutulması gereken diğer ayrıntıları ve yayınlama tekniklerinden bazılarını göreceksiniz. ✨
From dda233772293de978bade64ef2ed5fce3bd65e1c Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 23 May 2024 22:47:02 +0000
Subject: [PATCH 036/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index ba6cc8b5a..f0f15e299 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -19,6 +19,7 @@ hide:
### Translations
+* 🌐 Add Turkish translation for `docs/tr/docs/deployment/index.md`. PR [#11605](https://github.com/tiangolo/fastapi/pull/11605) by [@hasansezertasan](https://github.com/hasansezertasan).
* 🌐 Add Turkish translation for `docs/tr/docs/tutorial/static-files.md`. PR [#11599](https://github.com/tiangolo/fastapi/pull/11599) by [@hasansezertasan](https://github.com/hasansezertasan).
* 🌐 Polish translation for `docs/pl/docs/fastapi-people.md`. PR [#10196](https://github.com/tiangolo/fastapi/pull/10196) by [@isulim](https://github.com/isulim).
* 🌐 Add Turkish translation for `docs/tr/docs/advanced/wsgi.md`. PR [#11575](https://github.com/tiangolo/fastapi/pull/11575) by [@hasansezertasan](https://github.com/hasansezertasan).
From a69f38340f5ca80e4d97fa0af7ea5f70b1d771a7 Mon Sep 17 00:00:00 2001
From: Nir Schulman
Date: Fri, 24 May 2024 01:59:02 +0300
Subject: [PATCH 037/366] =?UTF-8?q?=F0=9F=93=9D=20Restored=20Swagger-UI=20?=
=?UTF-8?q?links=20to=20use=20the=20latest=20version=20possible.=20(#11459?=
=?UTF-8?q?)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/de/docs/how-to/custom-docs-ui-assets.md | 4 ++--
docs/en/docs/how-to/custom-docs-ui-assets.md | 4 ++--
docs_src/custom_docs_ui/tutorial001.py | 4 ++--
fastapi/openapi/docs.py | 4 ++--
tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py | 6 ++----
5 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/docs/de/docs/how-to/custom-docs-ui-assets.md b/docs/de/docs/how-to/custom-docs-ui-assets.md
index 991eaf269..a9271b3f3 100644
--- a/docs/de/docs/how-to/custom-docs-ui-assets.md
+++ b/docs/de/docs/how-to/custom-docs-ui-assets.md
@@ -96,8 +96,8 @@ Sie können wahrscheinlich mit der rechten Maustaste auf jeden Link klicken und
**Swagger UI** verwendet folgende Dateien:
-* `swagger-ui-bundle.js`
-* `swagger-ui.css`
+* `swagger-ui-bundle.js`
+* `swagger-ui.css`
Und **ReDoc** verwendet diese Datei:
diff --git a/docs/en/docs/how-to/custom-docs-ui-assets.md b/docs/en/docs/how-to/custom-docs-ui-assets.md
index adc1c1ef4..053e5eacd 100644
--- a/docs/en/docs/how-to/custom-docs-ui-assets.md
+++ b/docs/en/docs/how-to/custom-docs-ui-assets.md
@@ -96,8 +96,8 @@ You can probably right-click each link and select an option similar to `Save lin
**Swagger UI** uses the files:
-* `swagger-ui-bundle.js`
-* `swagger-ui.css`
+* `swagger-ui-bundle.js`
+* `swagger-ui.css`
And **ReDoc** uses the file:
diff --git a/docs_src/custom_docs_ui/tutorial001.py b/docs_src/custom_docs_ui/tutorial001.py
index 4384433e3..f7ceb0c2f 100644
--- a/docs_src/custom_docs_ui/tutorial001.py
+++ b/docs_src/custom_docs_ui/tutorial001.py
@@ -14,8 +14,8 @@ async def custom_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.9.0/swagger-ui-bundle.js",
- swagger_css_url="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css",
+ 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",
)
diff --git a/fastapi/openapi/docs.py b/fastapi/openapi/docs.py
index 67815e0fb..c2ec358d2 100644
--- a/fastapi/openapi/docs.py
+++ b/fastapi/openapi/docs.py
@@ -53,7 +53,7 @@ def get_swagger_ui_html(
It is normally set to a CDN URL.
"""
),
- ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui-bundle.js",
+ ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js",
swagger_css_url: Annotated[
str,
Doc(
@@ -63,7 +63,7 @@ def get_swagger_ui_html(
It is normally set to a CDN URL.
"""
),
- ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui.css",
+ ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css",
swagger_favicon_url: Annotated[
str,
Doc(
diff --git a/tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py b/tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py
index 34a18b12c..aff070d74 100644
--- a/tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py
+++ b/tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py
@@ -20,10 +20,8 @@ def client():
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.9.0/swagger-ui-bundle.js" in response.text
- )
- assert "https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css" in 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):
From 86b410e62354398684e6357cf120082b3c45e0bc Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 23 May 2024 22:59:22 +0000
Subject: [PATCH 038/366] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index f0f15e299..2ac70c0da 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,10 @@ hide:
* 🌐 Add Turkish translation for `docs/tr/docs/tutorial/request-forms.md`. PR [#11553](https://github.com/tiangolo/fastapi/pull/11553) by [@hasansezertasan](https://github.com/hasansezertasan).
+### Upgrades
+
+* 📝 Restored Swagger-UI links to use the latest version possible.. PR [#11459](https://github.com/tiangolo/fastapi/pull/11459) by [@UltimateLobster](https://github.com/UltimateLobster).
+
### Docs
* 📝 Update JWT auth documentation to use PyJWT instead of pyhon-jose. PR [#11589](https://github.com/tiangolo/fastapi/pull/11589) by [@estebanx64](https://github.com/estebanx64).
From f7a11bc0b4ee380d46d1ee974707d37c633521ce Mon Sep 17 00:00:00 2001
From: chaoless <64477804+chaoless@users.noreply.github.com>
Date: Tue, 28 May 2024 00:19:21 +0800
Subject: [PATCH 039/366] =?UTF-8?q?=F0=9F=8C=90=20Update=20Chinese=20trans?=
=?UTF-8?q?lation=20for=20`docs/zh/docs/advanced/templates.md`=20(#11620)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/zh/docs/advanced/templates.md | 71 +++++++++++++++++++++---------
1 file changed, 49 insertions(+), 22 deletions(-)
diff --git a/docs/zh/docs/advanced/templates.md b/docs/zh/docs/advanced/templates.md
index d735f1697..612b69176 100644
--- a/docs/zh/docs/advanced/templates.md
+++ b/docs/zh/docs/advanced/templates.md
@@ -20,24 +20,12 @@ $ pip install jinja2
-如需使用静态文件,还要安装 `aiofiles`:
-
-