diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
index 4100781c5..51c069d9e 100644
--- a/.github/workflows/build-docs.yml
+++ b/.github/workflows/build-docs.yml
@@ -28,6 +28,8 @@ jobs:
- docs/**
- docs_src/**
- requirements-docs.txt
+ - .github/workflows/build-docs.yml
+ - .github/workflows/deploy-docs.yml
langs:
needs:
- changes
@@ -50,11 +52,13 @@ jobs:
run: pip install -r requirements-docs.txt
# Install MkDocs Material Insiders here just to put it in the cache for the rest of the steps
- name: Install Material for MkDocs Insiders
- if: ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false ) && steps.cache.outputs.cache-hit != 'true'
+ if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
run: |
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/mkdocstrings-python.git
+ - name: Verify README
+ run: python ./scripts/docs.py verify-readme
- name: Export Language Codes
id: show-langs
run: |
@@ -88,7 +92,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-docs.txt
- name: Install Material for MkDocs Insiders
- if: ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false ) && steps.cache.outputs.cache-hit != 'true'
+ if: ( github.event_name != 'pull_request' || github.secret_source != 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
run: |
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
diff --git a/.github/workflows/latest-changes.yml b/.github/workflows/latest-changes.yml
index ffec5ee5e..b9b550d5e 100644
--- a/.github/workflows/latest-changes.yml
+++ b/.github/workflows/latest-changes.yml
@@ -34,9 +34,12 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- - uses: docker://tiangolo/latest-changes:0.0.3
+ - uses: docker://tiangolo/latest-changes:0.2.0
+ # - uses: tiangolo/latest-changes@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
latest_changes_file: docs/en/docs/release-notes.md
- latest_changes_header: '## Latest Changes\n\n'
+ latest_changes_header: '## Latest Changes'
+ end_regex: '^## '
debug_logs: true
+ label_header_prefix: '### '
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 9f7085f72..a7f2fb3f2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -13,23 +13,13 @@ repos:
- --unsafe
- id: end-of-file-fixer
- id: trailing-whitespace
-- repo: https://github.com/asottile/pyupgrade
- rev: v3.7.0
- hooks:
- - id: pyupgrade
- args:
- - --py3-plus
- - --keep-runtime-typing
- repo: https://github.com/charliermarsh/ruff-pre-commit
- rev: v0.0.275
+ rev: v0.1.2
hooks:
- id: ruff
args:
- --fix
-- repo: https://github.com/psf/black
- rev: 23.3.0
- hooks:
- - id: black
+ - id: ruff-format
ci:
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate
diff --git a/CITATION.cff b/CITATION.cff
new file mode 100644
index 000000000..9028248b1
--- /dev/null
+++ b/CITATION.cff
@@ -0,0 +1,24 @@
+# This CITATION.cff file was generated with cffinit.
+# Visit https://bit.ly/cffinit to generate yours today!
+
+cff-version: 1.2.0
+title: FastAPI
+message: >-
+ If you use this software, please cite it using the
+ metadata from this file.
+type: software
+authors:
+ - given-names: Sebastián
+ family-names: Ramírez
+ email: tiangolo@gmail.com
+identifiers:
+repository-code: 'https://github.com/tiangolo/fastapi'
+url: 'https://fastapi.tiangolo.com'
+abstract: >-
+ FastAPI framework, high performance, easy to learn, fast to code,
+ ready for production
+keywords:
+ - fastapi
+ - pydantic
+ - starlette
+license: MIT
diff --git a/README.md b/README.md
index aeb29b587..c8d17889d 100644
--- a/README.md
+++ b/README.md
@@ -48,9 +48,10 @@ The key features are:
-
+
+
@@ -59,6 +60,7 @@ The key features are:
+
diff --git a/docs/em/docs/advanced/settings.md b/docs/em/docs/advanced/settings.md
index bc50bf755..2ebe8ffcb 100644
--- a/docs/em/docs/advanced/settings.md
+++ b/docs/em/docs/advanced/settings.md
@@ -221,7 +221,7 @@ $ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" uvicorn main:app
```
!!! tip
- 👥 🔜 🔬 `@lru_cache()` 🍖.
+ 👥 🔜 🔬 `@lru_cache` 🍖.
🔜 👆 💪 🤔 `get_settings()` 😐 🔢.
@@ -254,7 +254,7 @@ $ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" uvicorn main:app
✋️ 🇨🇻 📁 🚫 🤙 ✔️ ✔️ 👈 ☑ 📁.
-Pydantic ✔️ 🐕🦺 👂 ⚪️➡️ 👉 🆎 📁 ⚙️ 🔢 🗃. 👆 💪 ✍ 🌖 Pydantic ⚒: 🇨🇻 (.🇨🇻) 🐕🦺.
+Pydantic ✔️ 🐕🦺 👂 ⚪️➡️ 👉 🆎 📁 ⚙️ 🔢 🗃. 👆 💪 ✍ 🌖 Pydantic ⚒: 🇨🇻 (.🇨🇻) 🐕🦺.
!!! tip
👉 👷, 👆 💪 `pip install python-dotenv`.
@@ -302,7 +302,7 @@ def get_settings():
👥 🔜 ✍ 👈 🎚 🔠 📨, & 👥 🔜 👂 `.env` 📁 🔠 📨. 👶 👶
-✋️ 👥 ⚙️ `@lru_cache()` 👨🎨 🔛 🔝, `Settings` 🎚 🔜 ✍ 🕴 🕐, 🥇 🕰 ⚫️ 🤙. 👶 👶
+✋️ 👥 ⚙️ `@lru_cache` 👨🎨 🔛 🔝, `Settings` 🎚 🔜 ✍ 🕴 🕐, 🥇 🕰 ⚫️ 🤙. 👶 👶
```Python hl_lines="1 10"
{!../../../docs_src/settings/app03/main.py!}
@@ -312,14 +312,14 @@ def get_settings():
#### `lru_cache` 📡 ℹ
-`@lru_cache()` 🔀 🔢 ⚫️ 🎀 📨 🎏 💲 👈 📨 🥇 🕰, ↩️ 💻 ⚫️ 🔄, 🛠️ 📟 🔢 🔠 🕰.
+`@lru_cache` 🔀 🔢 ⚫️ 🎀 📨 🎏 💲 👈 📨 🥇 🕰, ↩️ 💻 ⚫️ 🔄, 🛠️ 📟 🔢 🔠 🕰.
, 🔢 🔛 ⚫️ 🔜 🛠️ 🕐 🔠 🌀 ❌. & ⤴️ 💲 📨 🔠 👈 🌀 ❌ 🔜 ⚙️ 🔄 & 🔄 🕐❔ 🔢 🤙 ⏮️ ⚫️❔ 🎏 🌀 ❌.
🖼, 🚥 👆 ✔️ 🔢:
```Python
-@lru_cache()
+@lru_cache
def say_hi(name: str, salutation: str = "Ms."):
return f"Hello {salutation} {name}"
```
@@ -371,7 +371,7 @@ participant execute as Execute function
👈 🌌, ⚫️ 🎭 🌖 🚥 ⚫️ 🌐 🔢. ✋️ ⚫️ ⚙️ 🔗 🔢, ⤴️ 👥 💪 🔐 ⚫️ 💪 🔬.
-`@lru_cache()` 🍕 `functools` ❔ 🍕 🐍 🐩 🗃, 👆 💪 ✍ 🌅 🔃 ⚫️ 🐍 🩺 `@lru_cache()`.
+`@lru_cache` 🍕 `functools` ❔ 🍕 🐍 🐩 🗃, 👆 💪 ✍ 🌅 🔃 ⚫️ 🐍 🩺 `@lru_cache`.
## 🌃
@@ -379,4 +379,4 @@ participant execute as Execute function
* ⚙️ 🔗 👆 💪 📉 🔬.
* 👆 💪 ⚙️ `.env` 📁 ⏮️ ⚫️.
-* ⚙️ `@lru_cache()` ➡️ 👆 ❎ 👂 🇨🇻 📁 🔄 & 🔄 🔠 📨, ⏪ 🤝 👆 🔐 ⚫️ ⏮️ 🔬.
+* ⚙️ `@lru_cache` ➡️ 👆 ❎ 👂 🇨🇻 📁 🔄 & 🔄 🔠 📨, ⏪ 🤝 👆 🔐 ⚫️ ⏮️ 🔬.
diff --git a/docs/em/docs/async.md b/docs/em/docs/async.md
index 13b362b5d..ddcae1573 100644
--- a/docs/em/docs/async.md
+++ b/docs/em/docs/async.md
@@ -409,11 +409,11 @@ async def read_burgers():
### 🔗
-🎏 ✔ [🔗](/tutorial/dependencies/index.md){.internal-link target=_blank}. 🚥 🔗 🐩 `def` 🔢 ↩️ `async def`, ⚫️ 🏃 🔢 🧵.
+🎏 ✔ [🔗](./tutorial/dependencies/index.md){.internal-link target=_blank}. 🚥 🔗 🐩 `def` 🔢 ↩️ `async def`, ⚫️ 🏃 🔢 🧵.
### 🎧-🔗
-👆 💪 ✔️ 💗 🔗 & [🎧-🔗](/tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} 🚫 🔠 🎏 (🔢 🔢 🔑), 👫 💪 ✍ ⏮️ `async def` & ⏮️ 😐 `def`. ⚫️ 🔜 👷, & 🕐 ✍ ⏮️ 😐 `def` 🔜 🤙 🔛 🔢 🧵 (⚪️➡️ 🧵) ↩️ ➖ "⌛".
+👆 💪 ✔️ 💗 🔗 & [🎧-🔗](./tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} 🚫 🔠 🎏 (🔢 🔢 🔑), 👫 💪 ✍ ⏮️ `async def` & ⏮️ 😐 `def`. ⚫️ 🔜 👷, & 🕐 ✍ ⏮️ 😐 `def` 🔜 🤙 🔛 🔢 🧵 (⚪️➡️ 🧵) ↩️ ➖ "⌛".
### 🎏 🚙 🔢
diff --git a/docs/em/docs/external-links.md b/docs/em/docs/external-links.md
index 4440b1f12..5ba668bfa 100644
--- a/docs/em/docs/external-links.md
+++ b/docs/em/docs/external-links.md
@@ -11,77 +11,21 @@
## 📄
-### 🇪🇸
+{% for section_name, section_content in external_links.items() %}
-{% if external_links %}
-{% for article in external_links.articles.english %}
+## {{ section_name }}
+
+{% for lang_name, lang_content in section_content.items() %}
+
+### {{ lang_name }}
+
+{% for item in lang_content %}
+
+* {{ item.title }} by {{ item.author }}.
-* {{ article.title }} {{ article.author }}.
{% endfor %}
-{% endif %}
-
-### 🇯🇵
-
-{% if external_links %}
-{% for article in external_links.articles.japanese %}
-
-* {{ article.title }} {{ article.author }}.
{% endfor %}
-{% endif %}
-
-### 🇻🇳
-
-{% if external_links %}
-{% for article in external_links.articles.vietnamese %}
-
-* {{ article.title }} {{ article.author }}.
{% endfor %}
-{% endif %}
-
-### 🇷🇺
-
-{% if external_links %}
-{% for article in external_links.articles.russian %}
-
-* {{ article.title }} {{ article.author }}.
-{% endfor %}
-{% endif %}
-
-### 🇩🇪
-
-{% if external_links %}
-{% for article in external_links.articles.german %}
-
-* {{ article.title }} {{ article.author }}.
-{% endfor %}
-{% endif %}
-
-### 🇹🇼
-
-{% if external_links %}
-{% for article in external_links.articles.taiwanese %}
-
-* {{ article.title }} {{ article.author }}.
-{% endfor %}
-{% endif %}
-
-## 📻
-
-{% if external_links %}
-{% for article in external_links.podcasts.english %}
-
-* {{ article.title }} {{ article.author }}.
-{% endfor %}
-{% endif %}
-
-## 💬
-
-{% if external_links %}
-{% for article in external_links.talks.english %}
-
-* {{ article.title }} {{ article.author }}.
-{% endfor %}
-{% endif %}
## 🏗
diff --git a/docs/em/docs/index.md b/docs/em/docs/index.md
index ea8a9d41c..c7df28160 100644
--- a/docs/em/docs/index.md
+++ b/docs/em/docs/index.md
@@ -27,7 +27,7 @@
---
-FastAPI 🏛, ⏩ (↕-🎭), 🕸 🛠️ 🏗 🛠️ ⏮️ 🐍 3️⃣.7️⃣ ➕ ⚓️ 🔛 🐩 🐍 🆎 🔑.
+FastAPI 🏛, ⏩ (↕-🎭), 🕸 🛠️ 🏗 🛠️ ⏮️ 🐍 3️⃣.8️⃣ ➕ ⚓️ 🔛 🐩 🐍 🆎 🔑.
🔑 ⚒:
diff --git a/docs/em/docs/tutorial/query-params-str-validations.md b/docs/em/docs/tutorial/query-params-str-validations.md
index d6b67bd51..f0e455abe 100644
--- a/docs/em/docs/tutorial/query-params-str-validations.md
+++ b/docs/em/docs/tutorial/query-params-str-validations.md
@@ -371,7 +371,7 @@ http://localhost:8000/items/
=== "🐍 3️⃣.1️⃣0️⃣ & 🔛"
- ```Python hl_lines="12"
+ ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial008_py310.py!}
```
@@ -421,7 +421,7 @@ http://127.0.0.1:8000/items/?item-query=foobaritems
=== "🐍 3️⃣.1️⃣0️⃣ & 🔛"
- ```Python hl_lines="17"
+ ```Python hl_lines="16"
{!> ../../../docs_src/query_params_str_validations/tutorial010_py310.py!}
```
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index a7f766d16..726e7eae7 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -1,5 +1,5 @@
-articles:
- english:
+Articles:
+ English:
- author: Adejumo Ridwan Suleiman
author_link: https://www.linkedin.com/in/adejumoridwan/
link: https://medium.com/python-in-plain-english/build-an-sms-spam-classifier-serverless-database-with-faunadb-and-fastapi-23dbb275bc5b
@@ -236,7 +236,7 @@ articles:
author_link: https://medium.com/@krishnardt365
link: https://medium.com/@krishnardt365/fastapi-docker-and-postgres-91943e71be92
title: Fastapi, Docker(Docker compose) and Postgres
- german:
+ German:
- author: Marcel Sander (actidoo)
author_link: https://www.actidoo.com
link: https://www.actidoo.com/de/blog/python-fastapi-domain-driven-design
@@ -249,7 +249,7 @@ articles:
author_link: https://hellocoding.de/autor/felix-schuermeyer/
link: https://hellocoding.de/blog/coding-language/python/fastapi
title: REST-API Programmieren mittels Python und dem FastAPI Modul
- japanese:
+ Japanese:
- author: '@bee2'
author_link: https://qiita.com/bee2
link: https://qiita.com/bee2/items/75d9c0d7ba20e7a4a0e9
@@ -298,7 +298,7 @@ articles:
author_link: https://qiita.com/mtitg
link: https://qiita.com/mtitg/items/47770e9a562dd150631d
title: FastAPI|DB接続してCRUDするPython製APIサーバーを構築
- russian:
+ Russian:
- author: Troy Köhler
author_link: https://www.linkedin.com/in/trkohler/
link: https://trkohler.com/fast-api-introduction-to-framework
@@ -311,18 +311,18 @@ articles:
author_link: https://habr.com/ru/users/57uff3r/
link: https://habr.com/ru/post/454440/
title: 'Мелкая питонячая радость #2: Starlette - Солидная примочка – FastAPI'
- vietnamese:
+ Vietnamese:
- author: Nguyễn Nhân
author_link: https://fullstackstation.com/author/figonking/
link: https://fullstackstation.com/fastapi-trien-khai-bang-docker/
title: 'FASTAPI: TRIỂN KHAI BẰNG DOCKER'
- taiwanese:
+ Taiwanese:
- author: Leon
author_link: http://editor.leonh.space/
link: https://editor.leonh.space/2022/tortoise/
title: 'Tortoise ORM / FastAPI 整合快速筆記'
-podcasts:
- english:
+Podcasts:
+ English:
- author: Podcast.`__init__`
author_link: https://www.pythonpodcast.com/
link: https://www.pythonpodcast.com/fastapi-web-application-framework-episode-259/
@@ -331,8 +331,8 @@ podcasts:
author_link: https://pythonbytes.fm/
link: https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855
title: FastAPI on PythonBytes
-talks:
- english:
+Talks:
+ English:
- author: Sebastián Ramírez (tiangolo)
author_link: https://twitter.com/tiangolo
link: https://www.youtube.com/watch?v=PnpTY1f4k2U
diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml
index dac47d2f0..113772964 100644
--- a/docs/en/data/sponsors.yml
+++ b/docs/en/data/sponsors.yml
@@ -5,15 +5,18 @@ gold:
- url: https://platform.sh/try-it-now/?utm_source=fastapi-signup&utm_medium=banner&utm_campaign=FastAPI-signup-June-2023
title: "Build, run and scale your apps on a modern, reliable, and secure PaaS."
img: https://fastapi.tiangolo.com/img/sponsors/platform-sh.png
- - url: https://www.buildwithfern.com/?utm_source=tiangolo&utm_medium=website&utm_campaign=main-badge
- title: Fern | SDKs and API docs
- img: https://fastapi.tiangolo.com/img/sponsors/fern.svg
- url: https://www.porter.run
title: Deploy FastAPI on AWS with a few clicks
img: https://fastapi.tiangolo.com/img/sponsors/porter.png
- url: https://bump.sh/fastapi?utm_source=fastapi&utm_medium=referral&utm_campaign=sponsor
title: Automate FastAPI documentation generation with Bump.sh
img: https://fastapi.tiangolo.com/img/sponsors/bump-sh.svg
+ - url: https://reflex.dev
+ title: Reflex
+ img: https://fastapi.tiangolo.com/img/sponsors/reflex.png
+ - url: https://github.com/scalar/scalar/?utm_source=fastapi&utm_medium=website&utm_campaign=main-badge
+ title: "Scalar: Beautiful Open-Source API References from Swagger/OpenAPI files"
+ img: https://fastapi.tiangolo.com/img/sponsors/scalar.svg
silver:
- url: https://www.deta.sh/?ref=fastapi
title: The launchpad for all your (team's) ideas
@@ -39,6 +42,9 @@ silver:
- url: https://www.svix.com/
title: Svix - Webhooks as a service
img: https://fastapi.tiangolo.com/img/sponsors/svix.svg
+ - url: https://www.codacy.com/?utm_source=github&utm_medium=sponsors&utm_id=pioneers
+ title: Take code reviews from hours to minutes
+ img: https://fastapi.tiangolo.com/img/sponsors/codacy.png
bronze:
- url: https://www.exoflare.com/open-source/?utm_source=FastAPI&utm_campaign=open_source
title: Biosecurity risk assessments made easy.
diff --git a/docs/en/data/sponsors_badge.yml b/docs/en/data/sponsors_badge.yml
index d67e27c87..4078454a8 100644
--- a/docs/en/data/sponsors_badge.yml
+++ b/docs/en/data/sponsors_badge.yml
@@ -14,9 +14,12 @@ logins:
- nihpo
- armand-sauzay
- databento-bot
+ - databento
- nanram22
- Flint-company
- porter-dev
- fern-api
- ndimares
- svixhq
+ - Alek99
+ - codacy
diff --git a/docs/en/docs/advanced/generate-clients.md b/docs/en/docs/advanced/generate-clients.md
index 07a8f039f..e8d771f71 100644
--- a/docs/en/docs/advanced/generate-clients.md
+++ b/docs/en/docs/advanced/generate-clients.md
@@ -20,10 +20,9 @@ Some of them also ✨ [**sponsor FastAPI**](../help-fastapi.md#sponsor-the-autho
And it shows their true commitment to FastAPI and its **community** (you), as they not only want to provide you a **good service** but also want to make sure you have a **good and healthy framework**, FastAPI. 🙇
-You might want to try their services and follow their guides:
+For example, you might want to try Speakeasy.
-* Fern
-* Speakeasy
+There are also several other companies offering similar services that you can search and find online. 🤓
## Generate a TypeScript Frontend Client
@@ -88,7 +87,7 @@ It could look like this:
"description": "",
"main": "index.js",
"scripts": {
- "generate-client": "openapi --input http://localhost:8000/openapi.json --output ./src/client --client axios"
+ "generate-client": "openapi --input http://localhost:8000/openapi.json --output ./src/client --client axios --useOptions --useUnionTypes"
},
"author": "",
"license": "",
@@ -107,7 +106,7 @@ After having that NPM `generate-client` script there, you can run it with:
$ npm run generate-client
frontend-app@1.0.0 generate-client /home/user/code/frontend-app
-> openapi --input http://localhost:8000/openapi.json --output ./src/client --client axios
+> openapi --input http://localhost:8000/openapi.json --output ./src/client --client axios --useOptions --useUnionTypes
```
@@ -247,7 +246,7 @@ Now as the end result is in a file `openapi.json`, you would modify the `package
"description": "",
"main": "index.js",
"scripts": {
- "generate-client": "openapi --input ./openapi.json --output ./src/client --client axios"
+ "generate-client": "openapi --input ./openapi.json --output ./src/client --client axios --useOptions --useUnionTypes"
},
"author": "",
"license": "",
diff --git a/docs/en/docs/advanced/settings.md b/docs/en/docs/advanced/settings.md
index d39130777..f6db8d2b1 100644
--- a/docs/en/docs/advanced/settings.md
+++ b/docs/en/docs/advanced/settings.md
@@ -276,7 +276,7 @@ Now we create a dependency that returns a new `config.Settings()`.
```
!!! tip
- We'll discuss the `@lru_cache()` in a bit.
+ We'll discuss the `@lru_cache` in a bit.
For now you can assume `get_settings()` is a normal function.
@@ -326,7 +326,7 @@ This practice is common enough that it has a name, these environment variables a
But a dotenv file doesn't really have to have that exact filename.
-Pydantic has support for reading from these types of files using an external library. You can read more at Pydantic Settings: Dotenv (.env) support.
+Pydantic has support for reading from these types of files using an external library. You can read more at Pydantic Settings: Dotenv (.env) support.
!!! tip
For this to work, you need to `pip install python-dotenv`.
@@ -388,7 +388,7 @@ def get_settings():
we would create that object for each request, and we would be reading the `.env` file for each request. ⚠️
-But as we are using the `@lru_cache()` decorator on top, the `Settings` object will be created only once, the first time it's called. ✔️
+But as we are using the `@lru_cache` decorator on top, the `Settings` object will be created only once, the first time it's called. ✔️
=== "Python 3.9+"
@@ -415,14 +415,14 @@ Then for any subsequent calls of `get_settings()` in the dependencies for the ne
#### `lru_cache` Technical Details
-`@lru_cache()` modifies the function it decorates to return the same value that was returned the first time, instead of computing it again, executing the code of the function every time.
+`@lru_cache` modifies the function it decorates to return the same value that was returned the first time, instead of computing it again, executing the code of the function every time.
So, the function below it will be executed once for each combination of arguments. And then the values returned by each of those combinations of arguments will be used again and again whenever the function is called with exactly the same combination of arguments.
For example, if you have a function:
```Python
-@lru_cache()
+@lru_cache
def say_hi(name: str, salutation: str = "Ms."):
return f"Hello {salutation} {name}"
```
@@ -474,7 +474,7 @@ In the case of our dependency `get_settings()`, the function doesn't even take a
That way, it behaves almost as if it was just a global variable. But as it uses a dependency function, then we can override it easily for testing.
-`@lru_cache()` is part of `functools` which is part of Python's standard library, you can read more about it in the Python docs for `@lru_cache()`.
+`@lru_cache` is part of `functools` which is part of Python's standard library, you can read more about it in the Python docs for `@lru_cache`.
## Recap
@@ -482,4 +482,4 @@ You can use Pydantic Settings to handle the settings or configurations for your
* By using a dependency you can simplify testing.
* You can use `.env` files with it.
-* Using `@lru_cache()` lets you avoid reading the dotenv file again and again for each request, while allowing you to override it during testing.
+* Using `@lru_cache` lets you avoid reading the dotenv file again and again for each request, while allowing you to override it during testing.
diff --git a/docs/en/docs/alternatives.md b/docs/en/docs/alternatives.md
index a777ddb98..0f074ccf3 100644
--- a/docs/en/docs/alternatives.md
+++ b/docs/en/docs/alternatives.md
@@ -119,8 +119,6 @@ That's why when talking about version 2.0 it's common to say "Swagger", and for
These two were chosen for being fairly popular and stable, but doing a quick search, you could find dozens of additional alternative user interfaces for OpenAPI (that you can use with **FastAPI**).
- For example, you could try Fern which is also a FastAPI sponsor. 😎🎉
-
### Flask REST frameworks
There are several Flask REST frameworks, but after investing the time and work into investigating them, I found that many are discontinued or abandoned, with several standing issues that made them unfit.
diff --git a/docs/en/docs/async.md b/docs/en/docs/async.md
index 3d4b1956a..2ead1f2db 100644
--- a/docs/en/docs/async.md
+++ b/docs/en/docs/async.md
@@ -409,11 +409,11 @@ Still, in both situations, chances are that **FastAPI** will [still be faster](/
### Dependencies
-The same applies for [dependencies](/tutorial/dependencies/index.md){.internal-link target=_blank}. If a dependency is a standard `def` function instead of `async def`, it is run in the external threadpool.
+The same applies for [dependencies](./tutorial/dependencies/index.md){.internal-link target=_blank}. If a dependency is a standard `def` function instead of `async def`, it is run in the external threadpool.
### Sub-dependencies
-You can have multiple dependencies and [sub-dependencies](/tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} requiring each other (as parameters of the function definitions), some of them might be created with `async def` and some with normal `def`. It would still work, and the ones created with normal `def` would be called on an external thread (from the threadpool) instead of being "awaited".
+You can have multiple dependencies and [sub-dependencies](./tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} requiring each other (as parameters of the function definitions), some of them might be created with `async def` and some with normal `def`. It would still work, and the ones created with normal `def` would be called on an external thread (from the threadpool) instead of being "awaited".
### Other utility functions
diff --git a/docs/en/docs/external-links.md b/docs/en/docs/external-links.md
index 0c91470bc..b89021ee2 100644
--- a/docs/en/docs/external-links.md
+++ b/docs/en/docs/external-links.md
@@ -9,79 +9,21 @@ Here's an incomplete list of some of them.
!!! tip
If you have an article, project, tool, or anything related to **FastAPI** that is not yet listed here, create a Pull Request adding it.
-## Articles
+{% for section_name, section_content in external_links.items() %}
-### English
+## {{ section_name }}
-{% if external_links %}
-{% for article in external_links.articles.english %}
+{% for lang_name, lang_content in section_content.items() %}
+
+### {{ lang_name }}
+
+{% for item in lang_content %}
+
+* {{ item.title }} by {{ item.author }}.
-* {{ article.title }} by {{ article.author }}.
{% endfor %}
-{% endif %}
-
-### Japanese
-
-{% if external_links %}
-{% for article in external_links.articles.japanese %}
-
-* {{ article.title }} by {{ article.author }}.
{% endfor %}
-{% endif %}
-
-### Vietnamese
-
-{% if external_links %}
-{% for article in external_links.articles.vietnamese %}
-
-* {{ article.title }} by {{ article.author }}.
{% endfor %}
-{% endif %}
-
-### Russian
-
-{% if external_links %}
-{% for article in external_links.articles.russian %}
-
-* {{ article.title }} by {{ article.author }}.
-{% endfor %}
-{% endif %}
-
-### German
-
-{% if external_links %}
-{% for article in external_links.articles.german %}
-
-* {{ article.title }} by {{ article.author }}.
-{% endfor %}
-{% endif %}
-
-### Taiwanese
-
-{% if external_links %}
-{% for article in external_links.articles.taiwanese %}
-
-* {{ article.title }} by {{ article.author }}.
-{% endfor %}
-{% endif %}
-
-## Podcasts
-
-{% if external_links %}
-{% for article in external_links.podcasts.english %}
-
-* {{ article.title }} by {{ article.author }}.
-{% endfor %}
-{% endif %}
-
-## Talks
-
-{% if external_links %}
-{% for article in external_links.talks.english %}
-
-* {{ article.title }} by {{ article.author }}.
-{% endfor %}
-{% endif %}
## Projects
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 f26324869..9726be2c7 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/en/docs/img/sponsors/codacy.png b/docs/en/docs/img/sponsors/codacy.png
new file mode 100644
index 000000000..baa615c2a
Binary files /dev/null and b/docs/en/docs/img/sponsors/codacy.png differ
diff --git a/docs/en/docs/img/sponsors/reflex-banner.png b/docs/en/docs/img/sponsors/reflex-banner.png
new file mode 100644
index 000000000..3095c3a7b
Binary files /dev/null and b/docs/en/docs/img/sponsors/reflex-banner.png differ
diff --git a/docs/en/docs/img/sponsors/reflex.png b/docs/en/docs/img/sponsors/reflex.png
new file mode 100644
index 000000000..59c46a110
Binary files /dev/null and b/docs/en/docs/img/sponsors/reflex.png differ
diff --git a/docs/en/docs/img/sponsors/scalar-banner.svg b/docs/en/docs/img/sponsors/scalar-banner.svg
new file mode 100644
index 000000000..bab74e2d7
--- /dev/null
+++ b/docs/en/docs/img/sponsors/scalar-banner.svg
@@ -0,0 +1 @@
+
diff --git a/docs/en/docs/img/sponsors/scalar.svg b/docs/en/docs/img/sponsors/scalar.svg
new file mode 100644
index 000000000..174c57ee2
--- /dev/null
+++ b/docs/en/docs/img/sponsors/scalar.svg
@@ -0,0 +1 @@
+
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 163e708b8..669f19de7 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,7 +7,31 @@ hide:
## Latest Changes
-* 🐛 Fix overriding MKDocs theme lang in hook. PR [#10490](https://github.com/tiangolo/fastapi/pull/10490) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update sponsors, add Scalar. PR [#10728](https://github.com/tiangolo/fastapi/pull/10728) by [@tiangolo](https://github.com/tiangolo).
+
+### Docs
+
+* 📝 Tweak default suggested configs for generating clients. PR [#10736](https://github.com/tiangolo/fastapi/pull/10736) by [@tiangolo](https://github.com/tiangolo).
+
+### Internal
+
+* 👷 Update build docs, verify README on CI. PR [#10750](https://github.com/tiangolo/fastapi/pull/10750) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update sponsors, remove Fern. PR [#10729](https://github.com/tiangolo/fastapi/pull/10729) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update sponsors, add Codacy. PR [#10677](https://github.com/tiangolo/fastapi/pull/10677) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update sponsors, add Reflex. PR [#10676](https://github.com/tiangolo/fastapi/pull/10676) by [@tiangolo](https://github.com/tiangolo).
+* 📝 Update release notes, move and check latest-changes. PR [#10588](https://github.com/tiangolo/fastapi/pull/10588) by [@tiangolo](https://github.com/tiangolo).
+* 👷 Upgrade latest-changes GitHub Action. PR [#10587](https://github.com/tiangolo/fastapi/pull/10587) by [@tiangolo](https://github.com/tiangolo).
+
+## 0.104.1
+
+### Fixes
+
+* 📌 Pin Swagger UI version to 5.9.0 temporarily to handle a bug crashing it in 5.9.1. PR [#10529](https://github.com/tiangolo/fastapi/pull/10529) by [@alejandraklachquin](https://github.com/alejandraklachquin).
+ * This is not really a bug in FastAPI but in Swagger UI, nevertheless pinning the version will work while a solution is found on the [Swagger UI side](https://github.com/swagger-api/swagger-ui/issues/9337).
+
+### Docs
+
+* 📝 Update data structure and render for external-links. PR [#10495](https://github.com/tiangolo/fastapi/pull/10495) by [@tiangolo](https://github.com/tiangolo).
* ✏️ Fix link to SPDX license identifier in `docs/en/docs/tutorial/metadata.md`. PR [#10433](https://github.com/tiangolo/fastapi/pull/10433) by [@worldworm](https://github.com/worldworm).
* 📝 Update example validation error from Pydantic v1 to match Pydantic v2 in `docs/en/docs/tutorial/path-params.md`. PR [#10043](https://github.com/tiangolo/fastapi/pull/10043) by [@giuliowaitforitdavide](https://github.com/giuliowaitforitdavide).
* ✏️ Fix typos in emoji docs and in some source examples. PR [#10438](https://github.com/tiangolo/fastapi/pull/10438) by [@afuetterer](https://github.com/afuetterer).
@@ -15,8 +39,24 @@ hide:
* ✏️ Fix typos and rewordings in `docs/en/docs/tutorial/body-nested-models.md`. PR [#10468](https://github.com/tiangolo/fastapi/pull/10468) by [@yogabonito](https://github.com/yogabonito).
* 📝 Update docs, remove references to removed `pydantic.Required` in `docs/en/docs/tutorial/query-params-str-validations.md`. PR [#10469](https://github.com/tiangolo/fastapi/pull/10469) by [@yogabonito](https://github.com/yogabonito).
* ✏️ Fix typo in `docs/en/docs/reference/index.md`. PR [#10467](https://github.com/tiangolo/fastapi/pull/10467) by [@tarsil](https://github.com/tarsil).
-* 🔥 Drop/close Gitter chat. Questions should go to GitHub Discussions, free conversations to Discord.. PR [#10485](https://github.com/tiangolo/fastapi/pull/10485) by [@tiangolo](https://github.com/tiangolo).
* 🔥 Remove unnecessary duplicated docstrings. PR [#10484](https://github.com/tiangolo/fastapi/pull/10484) by [@tiangolo](https://github.com/tiangolo).
+
+### Internal
+
+* ✏️ Update Pydantic links to dotenv support. PR [#10511](https://github.com/tiangolo/fastapi/pull/10511) by [@White-Mask](https://github.com/White-Mask).
+* ✏️ Update links in `docs/en/docs/async.md` and `docs/zh/docs/async.md` to make them relative. PR [#10498](https://github.com/tiangolo/fastapi/pull/10498) by [@hasnatsajid](https://github.com/hasnatsajid).
+* ✏️ Fix links in `docs/em/docs/async.md`. PR [#10507](https://github.com/tiangolo/fastapi/pull/10507) by [@hasnatsajid](https://github.com/hasnatsajid).
+* ✏️ Fix typo in `docs/em/docs/index.md`, Python 3.8. PR [#10521](https://github.com/tiangolo/fastapi/pull/10521) by [@kerriop](https://github.com/kerriop).
+* ⬆ Bump pillow from 9.5.0 to 10.1.0. PR [#10446](https://github.com/tiangolo/fastapi/pull/10446) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* ⬆ Update mkdocs-material requirement from <9.0.0,>=8.1.4 to >=8.1.4,<10.0.0. PR [#5862](https://github.com/tiangolo/fastapi/pull/5862) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* ⬆ Bump mkdocs-material from 9.1.21 to 9.4.7. PR [#10545](https://github.com/tiangolo/fastapi/pull/10545) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* 👷 Install MkDocs Material Insiders only when secrets are available, for Dependabot. PR [#10544](https://github.com/tiangolo/fastapi/pull/10544) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update sponsors badges, Databento. PR [#10519](https://github.com/tiangolo/fastapi/pull/10519) by [@tiangolo](https://github.com/tiangolo).
+* 👷 Adopt Ruff format. PR [#10517](https://github.com/tiangolo/fastapi/pull/10517) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Add `CITATION.cff` file for academic citations. PR [#10496](https://github.com/tiangolo/fastapi/pull/10496) by [@tiangolo](https://github.com/tiangolo).
+* 🐛 Fix overriding MKDocs theme lang in hook. PR [#10490](https://github.com/tiangolo/fastapi/pull/10490) by [@tiangolo](https://github.com/tiangolo).
+* 🔥 Drop/close Gitter chat. Questions should go to GitHub Discussions, free conversations to Discord.. PR [#10485](https://github.com/tiangolo/fastapi/pull/10485) by [@tiangolo](https://github.com/tiangolo).
+
## 0.104.0
## Features
diff --git a/docs/en/docs/tutorial/query-params-str-validations.md b/docs/en/docs/tutorial/query-params-str-validations.md
index 0e777f6a0..91ae615ff 100644
--- a/docs/en/docs/tutorial/query-params-str-validations.md
+++ b/docs/en/docs/tutorial/query-params-str-validations.md
@@ -737,7 +737,7 @@ And a `description`:
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="12"
+ ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial008_py310.py!}
```
@@ -835,7 +835,7 @@ Then pass the parameter `deprecated=True` to `Query`:
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="17"
+ ```Python hl_lines="16"
{!> ../../../docs_src/query_params_str_validations/tutorial010_py310.py!}
```
diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html
index 4c7f19fd4..c4aea9a8e 100644
--- a/docs/en/overrides/main.html
+++ b/docs/en/overrides/main.html
@@ -34,12 +34,6 @@
-
+
+