Compare commits

...

67 Commits

Author SHA1 Message Date
Sebastián Ramírez
22b02e26f9 🔖 Release version 0.136.2 2026-05-23 19:24:08 +02:00
github-actions[bot]
3b252a2a22 📝 Update release notes
[skip ci]
2026-05-23 17:23:30 +00:00
Sebastián Ramírez
c7fb7851b3 ♻️ Validate Server Sent Event fields to avoid applications from sending broken data (#15588) 2026-05-23 17:23:05 +00:00
github-actions[bot]
cb83b83dcf 📝 Update release notes
[skip ci]
2026-05-23 17:02:38 +00:00
Sebastián Ramírez
00f805cec9 Update tests, don't double dispose the engine (#15587) 2026-05-23 17:02:16 +00:00
github-actions[bot]
3675137523 📝 Update release notes
[skip ci]
2026-05-23 16:36:21 +00:00
Yurii Motov
7b57e42986 📝 Document --entrypoint CLI option (#15464) 2026-05-23 18:35:54 +02:00
github-actions[bot]
e16894ec5b 📝 Update release notes
[skip ci]
2026-05-23 15:33:10 +00:00
Roman Postnov
8b647e3405 ️ Speed up test suite via caching and fixture scopes to make it ~24% faster (#13583)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2026-05-23 17:32:48 +02:00
github-actions[bot]
4f37a43d32 📝 Update release notes
[skip ci]
2026-05-22 17:16:06 +00:00
Sebastián Ramírez
973230c782 🔥 Remove config files now in central GitHub repo (#15585) 2026-05-22 19:15:08 +02:00
github-actions[bot]
ecd70826eb 📝 Update release notes
[skip ci]
2026-05-22 09:11:29 +00:00
Sebastián Ramírez
c347875c9c 📝 Update and simplify docs about help and management (#15583) 2026-05-22 11:10:53 +02:00
github-actions[bot]
0b9863020d 📝 Update release notes
[skip ci]
2026-05-21 20:03:55 +00:00
Sebastián Ramírez
55a9ff2e5e 📝 Add docs references to central contributing docs (#15580) 2026-05-21 20:03:25 +00:00
github-actions[bot]
b95681eb5b 📝 Update release notes
[skip ci]
2026-05-21 06:55:49 +00:00
dependabot[bot]
c99e215ed8 ⬆ Bump urllib3 from 2.6.3 to 2.7.0 (#15502)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-21 08:55:21 +02:00
github-actions[bot]
4232d80e84 📝 Update release notes
[skip ci]
2026-05-21 06:49:11 +00:00
dependabot[bot]
87d1daeeea ⬆ Bump idna from 3.11 to 3.15 (#15565)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-21 08:48:48 +02:00
github-actions[bot]
60571d7ada 📝 Update release notes
[skip ci]
2026-05-21 06:39:04 +00:00
dependabot[bot]
a314e3be3b ⬆ Bump cloudflare/wrangler-action from 3.15.0 to 4.0.0 (#15571)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-21 08:38:39 +02:00
github-actions[bot]
b11805add7 📝 Update release notes
[skip ci]
2026-05-21 05:29:09 +00:00
Francisco Silva
74d735d518 🌐 Improve translation consistency in ‎docs/pt/docs/advanced/generate-clients.md‎ (#15456)
Co-authored-by: uilton <uilton@meta4chain.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
2026-05-21 07:28:41 +02:00
github-actions[bot]
ed7f49ed69 📝 Update release notes
[skip ci]
2026-05-20 16:12:24 +00:00
Sebastián Ramírez
3969ae8f38 📝 Update security policy (#15577) 2026-05-20 16:11:48 +00:00
github-actions[bot]
f4cafbc467 📝 Update release notes
[skip ci]
2026-05-19 17:41:11 +00:00
Sebastián Ramírez
31ced9d49e 🔧 Migrate docs from MkDocs to Zensical (#15563) 2026-05-19 19:40:41 +02:00
github-actions[bot]
6f9dcdf61a 📝 Update release notes
[skip ci]
2026-05-19 13:42:52 +00:00
Sebastián Ramírez
2b5cd26248 🍱 Update sponsors: TalorData image (#15562) 2026-05-19 15:42:23 +02:00
github-actions[bot]
5341528623 📝 Update release notes
[skip ci]
2026-05-18 15:40:01 +00:00
Sebastián Ramírez
ff6a38a434 🌐 Update translations for ja (update-outdated) (#15530)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com>
2026-05-18 17:39:27 +02:00
github-actions[bot]
626ae1918c 📝 Update release notes
[skip ci]
2026-05-18 15:22:32 +00:00
Sebastián Ramírez
3780ba5472 🌐 Update translations for uk (update-outdated) (#15529)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com>
2026-05-18 17:21:59 +02:00
github-actions[bot]
21697d9794 📝 Update release notes
[skip ci]
2026-05-18 15:19:10 +00:00
Sebastián Ramírez
628ff21528 🌐 Update translations for pt (update-outdated) (#15528)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com>
2026-05-18 17:15:46 +02:00
github-actions[bot]
bf3668de89 📝 Update release notes
[skip ci]
2026-05-18 15:14:32 +00:00
Sebastián Ramírez
f343905934 🌐 Update translations for de (update-outdated) (#15527)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com>
2026-05-18 17:13:52 +02:00
github-actions[bot]
3ab6f1b31d 📝 Update release notes
[skip ci]
2026-05-18 15:07:31 +00:00
Sebastián Ramírez
f3963927ec 🌐 Update translations for tr (update-outdated) (#15526)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com>
2026-05-18 17:06:50 +02:00
github-actions[bot]
1f48fb42fc 📝 Update release notes
[skip ci]
2026-05-18 15:00:52 +00:00
Sebastián Ramírez
5cfd983e1d 🌐 Update translations for ko (update-outdated) (#15525)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
2026-05-18 17:00:20 +02:00
github-actions[bot]
e3844f1972 📝 Update release notes
[skip ci]
2026-05-18 11:55:46 +00:00
Sebastián Ramírez
99812444ab 📝 Update docs, simplify usage of admonitions, only default ones (#15553) 2026-05-18 13:55:19 +02:00
github-actions[bot]
480fdba26a 📝 Update release notes
[skip ci]
2026-05-18 09:54:43 +00:00
Sebastián Ramírez
f0c3d87da2 🌐 Update translations for zh-hant (update-outdated) (#15524)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com>
2026-05-18 11:53:58 +02:00
github-actions[bot]
4047993ba8 📝 Update release notes
[skip ci]
2026-05-18 09:52:55 +00:00
Sebastián Ramírez
e6edf14a27 🌐 Update translations for fr (update-outdated) (#15522)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
2026-05-18 11:52:29 +02:00
github-actions[bot]
34a82b1b87 📝 Update release notes
[skip ci]
2026-05-18 09:06:54 +00:00
Sofie Van Landeghem
622dcdc99c 🔒️ Only allow team members to modify dependencies (#15548) 2026-05-18 11:06:23 +02:00
github-actions[bot]
8106d6391d 📝 Update release notes
[skip ci]
2026-05-18 08:55:57 +00:00
Sebastián Ramírez
6163cc7996 🌐 Update translations for es (update-outdated) (#15523)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
2026-05-18 08:55:28 +00:00
github-actions[bot]
c7171f86b2 📝 Update release notes
[skip ci]
2026-05-18 08:38:07 +00:00
Sebastián Ramírez
eff8bc4e66 🌐 Update translations for zh (update-outdated) (#15520)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
2026-05-18 10:37:41 +02:00
github-actions[bot]
9364f552e6 📝 Update release notes
[skip ci]
2026-05-18 08:26:50 +00:00
Sebastián Ramírez
72f127ddad 🌐 Update translations for ru (update-outdated) (#15521)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com>
2026-05-18 08:26:15 +00:00
github-actions[bot]
a35a0b8b62 📝 Update release notes
[skip ci]
2026-05-18 07:03:26 +00:00
Yurii Motov
3e2ef69479 📝 Fix image URLs in index.md (#15534) 2026-05-18 09:03:01 +02:00
github-actions[bot]
ecace740f3 📝 Update release notes
[skip ci]
2026-05-15 15:18:26 +00:00
dependabot[bot]
6939bf8bb7 ⬆ Bump actions/add-to-project from 1.0.2 to 2.0.0 (#15490)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-15 17:17:52 +02:00
github-actions[bot]
40e383e0b2 📝 Update release notes
[skip ci]
2026-05-15 13:03:21 +00:00
dependabot[bot]
a0f42dd7d5 ⬆ Bump actions/labeler from 6.0.1 to 6.1.0 (#15507)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-15 15:02:56 +02:00
github-actions[bot]
6f2dbb96ac 📝 Update release notes
[skip ci]
2026-05-15 10:16:08 +00:00
Sebastián Ramírez
b6abc93bff 🔧 Remove Ruff ignored rule for tabs (#15533) 2026-05-15 10:15:37 +00:00
github-actions[bot]
b31ffc1efd 📝 Update release notes
[skip ci]
2026-05-15 07:43:05 +00:00
Sebastián Ramírez
b71da659cf 🔧 Update sponsors badge (#15532) 2026-05-15 07:42:33 +00:00
github-actions[bot]
b70238d9e3 📝 Update release notes
[skip ci]
2026-05-15 07:10:03 +00:00
Sebastián Ramírez
2c26191e30 🔧 Add sponsor: TalorData (#15531) 2026-05-15 09:09:35 +02:00
137 changed files with 1455 additions and 1668 deletions

1
.github/FUNDING.yml vendored
View File

@@ -1 +0,0 @@
github: [tiangolo]

View File

@@ -14,7 +14,7 @@ jobs:
name: Add to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
- uses: actions/add-to-project@5afcf98fcd03f1c2f92c3c83f58ae24323cc57fd # v2.0.0
with:
project-url: https://github.com/orgs/fastapi/projects/2
github-token: ${{ secrets.PROJECTS_TOKEN }} # zizmor: ignore[secrets-outside-env]

View File

@@ -34,14 +34,13 @@ jobs:
- docs_src/**
- pyproject.toml
- uv.lock
- mkdocs.yml
- mkdocs.env.yml
- .github/workflows/build-docs.yml
- .github/workflows/deploy-docs.yml
- scripts/mkdocs_hooks.py
- scripts/docs.py
langs:
needs:
- changes
if: ${{ needs.changes.outputs.docs == 'true' }}
runs-on: ubuntu-latest
outputs:
langs: ${{ steps.show-langs.outputs.langs }}
@@ -103,21 +102,28 @@ jobs:
run: uv run ./scripts/docs.py update-languages
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
key: mkdocs-cards-${{ matrix.lang }}-${{ github.ref }}
path: docs/${{ matrix.lang }}/.cache
key: zensical-${{ matrix.lang }}-${{ github.ref }}
path: site_zensical_src/${{ matrix.lang }}/.cache
- name: Build Docs
run: | # zizmor: ignore[template-injection] - comes from trusted source
uv run ./scripts/docs.py build-lang ${{ matrix.lang }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: docs-site-${{ matrix.lang }}
path: ./site/**
# English owns root static assets. Translated pages reference /img, /css,
# and /js, so omit duplicated language-local copies from artifacts.
path: |
./site/**
!./site/${{ matrix.lang }}/img/**
!./site/${{ matrix.lang }}/css/**
!./site/${{ matrix.lang }}/js/**
include-hidden-files: true
# https://github.com/marketplace/actions/alls-green#why
docs-all-green: # This job does nothing and is only used for the branch protection
if: always()
needs:
- langs
- build-docs
runs-on: ubuntu-latest
steps:
@@ -125,4 +131,4 @@ jobs:
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}
allowed-skips: build-docs
allowed-skips: langs, build-docs

View File

@@ -60,7 +60,7 @@ jobs:
env:
PROJECT_NAME: fastapitiangolo
BRANCH: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3.15.0
uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} # zizmor: ignore[secrets-outside-env]
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} # zizmor: ignore[secrets-outside-env]

View File

@@ -0,0 +1,52 @@
name: Guard Dependencies
on:
pull_request_target: # zizmor: ignore[dangerous-triggers] -- This workflow only reads context.payload metadata, never checks out PR code
branches: [master]
paths:
- pyproject.toml
- uv.lock
permissions:
contents: read
issues: write
pull-requests: write
jobs:
check-author:
runs-on: ubuntu-latest
steps:
- name: Check if author is org member or allowed bot
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const pr = context.payload.pull_request;
const author = pr.user.login;
const assoc = pr.author_association;
const botAllowlist = new Set(['dependabot[bot]']);
const orgAuthorAssociations = new Set(['MEMBER', 'OWNER']);
const allowed =
botAllowlist.has(author) ||
(assoc != null && orgAuthorAssociations.has(assoc));
if (!allowed) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: `This PR modifies dependency files (\`pyproject.toml\` or \`uv.lock\`), which is restricted to members of the **${context.repo.owner}** organization on GitHub.\n\nIf you need a dependency change, please [open a discussion](https://github.com/${context.repo.owner}/${context.repo.repo}/discussions/new) describing what you need and why.\n\nClosing this PR automatically.`
});
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
state: 'closed'
});
core.setFailed('Dependency changes are restricted to organization members.');
} else {
console.log(`Author ${author} (author_association=${assoc}) is allowed to make dependency changes.`);
}

View File

@@ -18,7 +18,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
- uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
- run: echo "Done adding labels"
# Run this after labeler applied labels

1
.gitignore vendored
View File

@@ -7,6 +7,7 @@ __pycache__
htmlcov
dist
site
site_zensical_src
.coverage*
coverage.xml
.netlify

View File

@@ -1 +0,0 @@
Please read the [Development - Contributing](https://fastapi.tiangolo.com/contributing/) guidelines in the documentation site.

View File

@@ -70,6 +70,7 @@ The key features are:
<a href="https://www.permit.io/blog/implement-authorization-in-fastapi?utm_source=github&utm_medium=referral&utm_campaign=fastapi" target="_blank" title="Fine-Grained Authorization for FastAPI"><img src="https://fastapi.tiangolo.com/img/sponsors/permit.png"></a>
<a href="https://www.interviewpal.com/?utm_source=fastapi&utm_medium=open-source&utm_campaign=dev-hiring" target="_blank" title="InterviewPal - AI Interview Coach for Engineers and Devs"><img src="https://fastapi.tiangolo.com/img/sponsors/interviewpal.png"></a>
<a href="https://dribia.com/en/" target="_blank" title="Dribia - Data Science within your reach"><img src="https://fastapi.tiangolo.com/img/sponsors/dribia.png"></a>
<a href="https://talordata.com/?campaignid=oh5dVZ3Zc3YGiAI2&utm_source=fastapi&utm_term=fastapi" target="_blank" title="TalorData SERP API - Multi-Engine Search Results Data"><img src="https://fastapi.tiangolo.com/img/sponsors/talordata.png"></a>
<!-- /sponsors -->

View File

@@ -1,31 +0,0 @@
# Security Policy
Security is very important for FastAPI and its community. 🔒
Learn more about it below. 👇
## Versions
The latest version of FastAPI is supported.
You are encouraged to [write tests](https://fastapi.tiangolo.com/tutorial/testing/) for your application and update your FastAPI version frequently after ensuring that your tests are passing. This way you will benefit from the latest features, bug fixes, and **security fixes**.
You can learn more about [FastAPI versions and how to pin and upgrade them](https://fastapi.tiangolo.com/deployment/versions/) for your project in the docs.
## Reporting a Vulnerability
If you think you found a vulnerability, and even if you are not sure about it, please report it right away by sending an email to: security@tiangolo.com. Please try to be as explicit as possible, describing all the steps and example code to reproduce the security issue.
I (the author, [@tiangolo](https://x.com/tiangolo)) will review it thoroughly and get back to you.
## Public Discussions
Please restrain from publicly discussing a potential security vulnerability. 🙊
It's better to discuss privately and try to find a solution first, to limit the potential impact as much as possible.
---
Thanks for your help!
The FastAPI community and I thank you for that. 🙇

View File

@@ -30,7 +30,6 @@ Ihr Sponsoring zeigt auch ein starkes Engagement für die FastAPI-**Community**
Zum Beispiel könnten Sie ausprobieren:
* [Speakeasy](https://speakeasy.com/editor?utm_source=fastapi+repo&utm_medium=github+sponsorship)
* [Stainless](https://www.stainless.com/?utm_source=fastapi&utm_medium=referral)
* [liblab](https://developers.liblab.com/tutorials/sdk-for-fastapi?utm_source=fastapi)

View File

@@ -1,3 +1,8 @@
---
include_yaml:
sponsors: data/sponsors.yml
---
# FastAPI { #fastapi }
<style>
@@ -54,18 +59,27 @@ Seine Schlüssel-Merkmale sind:
### Keystone-Sponsor { #keystone-sponsor }
<div class="fastapi-sponsors fastapi-sponsors--keystone">
{% for sponsor in sponsors.keystone -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--keystone" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}"></a>
{% endfor -%}
</div>
### Gold- und Silber-Sponsoren { #gold-and-silver-sponsors }
### Gold-Sponsoren { #gold-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--gold">
{% for sponsor in sponsors.gold -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--gold" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor -%}
{%- for sponsor in sponsors.silver -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
</div>
### Silber-Sponsoren { #silver-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--silver">
{% for sponsor in sponsors.silver -%}
<a class="fastapi-sponsors__card fastapi-sponsors__card--silver" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor %}
</div>
<!-- /sponsors -->
@@ -73,6 +87,44 @@ Seine Schlüssel-Merkmale sind:
## Meinungen { #opinions }
<!-- only-mkdocs -->
<div class="fastapi-opinions" data-fastapi-opinions>
<div class="fastapi-opinions__tabs" role="tablist" aria-label="Companies using FastAPI">
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-microsoft" aria-controls="fo-panel-microsoft" aria-selected="true" tabindex="0">
<span class="fastapi-opinions__mark"><img src="/img/logos/microsoft.svg" alt="Microsoft" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-uber" aria-controls="fo-panel-uber" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/uber.svg" alt="Uber" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-netflix" aria-controls="fo-panel-netflix" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/netflix.svg" alt="Netflix" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-cisco" aria-controls="fo-panel-cisco" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/cisco.svg" alt="Cisco" loading="lazy"></span>
</button>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-microsoft" role="tabpanel" aria-labelledby="fo-tab-microsoft" tabindex="0">
<blockquote class="fastapi-opinions__quote">„Ich verwende <strong>FastAPI</strong> heutzutage sehr oft. Ich plane tatsächlich, es für alle <strong>ML-Services meines Teams bei Microsoft</strong> zu verwenden. Einige davon werden in das Kernprodukt <strong>Windows</strong> und einige <strong>Office</strong>-Produkte integriert.“</blockquote>
<div class="fastapi-opinions__attr">— Kabir Khan, <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26">(Ref.)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-uber" role="tabpanel" aria-labelledby="fo-tab-uber" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">„Wir haben die <strong>FastAPI</strong>-Bibliothek übernommen, um einen <strong>REST</strong>-Server zu erstellen, der für <strong>Vorhersagen</strong> abgefragt werden kann.“ <em>[für Ludwig]</em></blockquote>
<div class="fastapi-opinions__attr">— Piero Molino, Yaroslav Dudin, Sai Sumanth Miryala, <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/">(Ref.)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-netflix" role="tabpanel" aria-labelledby="fo-tab-netflix" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">„<strong>Netflix</strong> freut sich, die Open-Source-Veröffentlichung unseres <strong>Krisenmanagement</strong>-Orchestrierungsframeworks bekannt zu geben: <strong>Dispatch</strong>!“ <em>[erstellt mit FastAPI]</em></blockquote>
<div class="fastapi-opinions__attr">— Kevin Glisson, Marc Vilanova, Forest Monsen, <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072">(Ref.)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-cisco" role="tabpanel" aria-labelledby="fo-tab-cisco" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">„Falls irgendjemand eine Produktions-Python-API erstellen möchte, kann ich <strong>FastAPI</strong> wärmstens empfehlen. Es ist <strong>wunderschön konzipiert</strong>, <strong>einfach zu verwenden</strong> und <strong>hoch skalierbar</strong> es ist zu einer <strong>Schlüsselkomponente</strong> unserer API-First-Entwicklungsstrategie geworden.“</blockquote>
<div class="fastapi-opinions__attr">— Deon Pillsbury, <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/">(Ref.)</a></div>
</div>
</div>
<!-- /only-mkdocs -->
<div class="only-github" markdown="1">
„_[...] Ich verwende **FastAPI** heutzutage sehr oft. [...] Ich habe tatsächlich vor, es für alle **ML-Services meines Teams bei Microsoft** zu verwenden. Einige davon werden in das Kernprodukt **Windows** und einige **Office**-Produkte integriert._“
<div style="text-align: right; margin-right: 10%;">Kabir Khan <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26"><small>(Ref.)</small></a></div>
@@ -85,43 +137,31 @@ Seine Schlüssel-Merkmale sind:
---
„_**Netflix** freut sich, die Open-Source-Veröffentlichung unseres **Krisenmanagement**-Orchestrierung-Frameworks bekannt zu geben: **Dispatch**! [erstellt mit **FastAPI**]_“
„_**Netflix** freut sich, die Open-Source-Veröffentlichung unseres **Krisenmanagement**-Orchestrierungsframeworks bekannt zu geben: **Dispatch**! [erstellt mit **FastAPI**]_“
<div style="text-align: right; margin-right: 10%;">Kevin Glisson, Marc Vilanova, Forest Monsen <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072"><small>(Ref.)</small></a></div>
---
„_Ich bin hellauf begeistert von **FastAPI**. Es macht so viel Spaß!_“
<div style="text-align: right; margin-right: 10%;">Brian Okken <strong>[Python Bytes](https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855) Podcast-Host</strong> <a href="https://x.com/brianokken/status/1112220079972728832"><small>(Ref.)</small></a></div>
---
„_Ehrlich, was Du gebaut hast, sieht super solide und poliert aus. In vielerlei Hinsicht ist es so, wie ich **Hug** haben wollte es ist wirklich inspirierend, jemanden so etwas bauen zu sehen._“
<div style="text-align: right; margin-right: 10%;">Timothy Crosley <strong>[Hug](https://github.com/hugapi/hug)-Autor</strong> <a href="https://news.ycombinator.com/item?id=19455465"><small>(Ref.)</small></a></div>
---
„_Wenn Sie ein **modernes Framework** zum Erstellen von REST-APIs erlernen möchten, schauen Sie sich **FastAPI** an. [...] Es ist schnell, einfach zu verwenden und leicht zu lernen [...]_“
„_Wir haben zu **FastAPI** für unsere **APIs** gewechselt [...] Ich denke, es wird Ihnen gefallen [...]_“
<div style="text-align: right; margin-right: 10%;">Ines Montani Matthew Honnibal <strong>[Explosion AI](https://explosion.ai)-Gründer [spaCy](https://spacy.io)-Autoren</strong> <a href="https://x.com/_inesmontani/status/1144173225322143744"><small>(Ref.)</small></a> <a href="https://x.com/honnibal/status/1144031421859655680"><small>(Ref.)</small></a></div>
---
„_Falls irgendjemand eine Produktions-Python-API erstellen möchte, kann ich **FastAPI** wärmstens empfehlen. Es ist **wunderschön konzipiert**, **einfach zu verwenden** und **hoch skalierbar**; es ist zu einer **Schlüsselkomponente** unserer API-First-Entwicklungsstrategie geworden und treibt viele Automatisierungen und Services an, wie etwa unseren Virtual TAC Engineer._“
<div style="text-align: right; margin-right: 10%;">Deon Pillsbury <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/"><small>(Ref.)</small></a></div>
---
</div>
## FastAPI Conf { #fastapi-conf }
[**FastAPI Conf 26**](https://fastapiconf.com) findet am **28. Oktober 2026** in **Amsterdam, NL** statt. Alles über FastAPI, direkt von der Quelle. 🎤
<a class="fastapi-feature-banner" href="https://fastapiconf.com"><img src="https://fastapi.tiangolo.com/img/fastapi-conf.jpeg" alt="FastAPI Conf 26 - 28. Oktober 2026 - Amsterdam, NL"></a>
## FastAPI Mini-Dokumentarfilm { #fastapi-mini-documentary }
Es gibt einen [FastAPI-Mini-Dokumentarfilm](https://www.youtube.com/watch?v=mpR8ngthqiE), veröffentlicht Ende 2025, Sie können ihn online ansehen:
<a href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini-Dokumentarfilm"></a>
<a class="fastapi-feature-banner" href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini-Dokumentarfilm"></a>
## **Typer**, das FastAPI der CLIs { #typer-the-fastapi-of-clis }

View File

@@ -2,7 +2,7 @@
Wenn Sie an Python-Projekten arbeiten, sollten Sie wahrscheinlich eine **virtuelle Umgebung** (oder einen ähnlichen Mechanismus) verwenden, um die <abbr title="Python Installationspakete">Packages</abbr>, die Sie für jedes Projekt installieren, zu isolieren.
/// info | Info
/// note | Hinweis
Wenn Sie bereits über virtuelle Umgebungen Bescheid wissen, wie man sie erstellt und verwendet, möchten Sie diesen Abschnitt vielleicht überspringen. 🤓
@@ -18,7 +18,7 @@ Eine **virtuelle Umgebung** ist ein Verzeichnis mit einigen Dateien darin.
///
/// info | Info
/// note | Hinweis
Diese Seite wird Ihnen beibringen, wie Sie **virtuelle Umgebungen** verwenden und wie sie funktionieren.
@@ -817,7 +817,7 @@ Traceback (most recent call last):
</div>
Wenn Sie jedoch die virtuelle Umgebung deaktivieren und die neue für `prisoner-of-askaban` aktivieren, wird beim Ausführen von `python` das Python aus der virtuellen Umgebung in `prisoner-of-azkaban` verwendet.
Wenn Sie jedoch die virtuelle Umgebung deaktivieren und die neue für `prisoner-of-azkaban` aktivieren, wird beim Ausführen von `python` das Python aus der virtuellen Umgebung in `prisoner-of-azkaban` verwendet.
<div class="termy">

View File

@@ -1 +0,0 @@
INHERIT: ../en/mkdocs.yml

View File

@@ -52,6 +52,9 @@ silver:
- url: https://dribia.com/en/
title: Dribia - Data Science within your reach
img: https://fastapi.tiangolo.com/img/sponsors/dribia.png
- url: https://talordata.com/?campaignid=oh5dVZ3Zc3YGiAI2&utm_source=fastapi&utm_term=fastapi
title: TalorData SERP API - Multi-Engine Search Results Data
img: https://fastapi.tiangolo.com/img/sponsors/talordata.png
bronze:
- url: https://www.exoflare.com/open-source/?utm_source=FastAPI&utm_campaign=open_source
title: Biosecurity risk assessments made easy.

View File

@@ -48,3 +48,4 @@ logins:
- subtotal
- requestly
- greptileai
- talorelowen

View File

@@ -124,10 +124,6 @@ See section `### Content of code blocks` in the general prompt in `scripts/trans
//// tab | Test
/// info
Some text
///
/// note
Some text
///
@@ -136,10 +132,6 @@ Some text
Some text
///
/// check
Some text
///
/// tip
Some text
///

View File

@@ -34,7 +34,7 @@ Keep in mind that you have to return the `JSONResponse` directly.
///
/// info
/// note
The `model` key is not part of OpenAPI.
@@ -183,7 +183,7 @@ Notice that you have to return the image using a `FileResponse` directly.
///
/// info
/// note
Unless you specify a different media type explicitly in your `responses` parameter, FastAPI will assume the response has the same media type as the main response class (default `application/json`).

View File

@@ -98,7 +98,7 @@ For example, if you had a database session in a dependency with `yield`, the `St
This behavior was reverted in 0.118.0, to make the exit code after `yield` be executed after the response is sent.
/// info
/// note
As you will see below, this is very similar to the behavior before version 0.106.0, but with several improvements and bug fixes for corner cases.

View File

@@ -41,7 +41,7 @@ To return a response with HTML directly from **FastAPI**, use `HTMLResponse`.
{* ../../docs_src/custom_response/tutorial002_py310.py hl[2,7] *}
/// info
/// note
The parameter `response_class` will also be used to define the "media type" of the response.
@@ -65,7 +65,7 @@ A `Response` returned directly by your *path operation function* won't be docume
///
/// info
/// note
Of course, the actual `Content-Type` header, status code, etc, will come from the `Response` object you returned.

View File

@@ -18,7 +18,7 @@ And of course, it supports the same:
This works the same way as with Pydantic models. And it is actually achieved in the same way underneath, using Pydantic.
/// info
/// note
Keep in mind that dataclasses can't do everything Pydantic models can do.

View File

@@ -120,7 +120,7 @@ To add a function that should be run when the application is shutting down, decl
Here, the `shutdown` event handler function will write a text line `"Application shutdown"` to a file `log.txt`.
/// info
/// note
In the `open()` function, the `mode="a"` means "append", so, the line will be added after whatever is on that file, without overwriting the previous contents.
@@ -152,7 +152,7 @@ Just a technical detail for the curious nerds. 🤓
Underneath, in the ASGI technical specification, this is part of the [Lifespan Protocol](https://asgi.readthedocs.io/en/latest/specs/lifespan.html), and it defines events called `startup` and `shutdown`.
/// info
/// note
You can read more about the Starlette `lifespan` handlers in [Starlette's Lifespan' docs](https://www.starlette.dev/lifespan/).

View File

@@ -22,7 +22,7 @@ With **FastAPI**, using OpenAPI, you can define the names of these webhooks, the
This can make it a lot easier for your users to **implement their APIs** to receive your **webhook** requests, they might even be able to autogenerate some of their own API code.
/// info
/// note
Webhooks are available in OpenAPI 3.1.0 and above, supported by FastAPI `0.99.0` and above.
@@ -36,7 +36,7 @@ When you create a **FastAPI** application, there is a `webhooks` attribute that
The webhooks that you define will end up in the **OpenAPI** schema and the automatic **docs UI**.
/// info
/// note
The `app.webhooks` object is actually just an `APIRouter`, the same type you would use when structuring your app with multiple files.

View File

@@ -18,7 +18,7 @@ You will normally have much better performance using a [Response Model](../tutor
You can return a `Response` or any sub-class of it.
/// info
/// note
`JSONResponse` itself is a sub-class of `Response`.

View File

@@ -46,7 +46,7 @@ They are normally used to declare specific security permissions, for example:
* `instagram_basic` is used by Facebook / Instagram.
* `https://www.googleapis.com/auth/drive` is used by Google.
/// info
/// note
In OAuth2 a "scope" is just a string that declares a specific permission required.
@@ -126,7 +126,7 @@ We are doing it here to demonstrate how **FastAPI** handles scopes declared at d
{* ../../docs_src/security/tutorial005_an_py310.py hl[5,141,172] *}
/// info | Technical Details
/// note | Technical Details
`Security` is actually a subclass of `Depends`, and it has just one extra parameter that we'll see later.

View File

@@ -4,7 +4,7 @@ If you want to stream data that can be structured as JSON, you should [Stream JS
But if you want to **stream pure binary data** or strings, here's how you can do it.
/// info
/// note
Added in FastAPI 0.134.0.
@@ -90,7 +90,7 @@ For example, they don't have an `await file.read()`, or `async for chunk in file
And in many cases, reading them would be a blocking operation (that could block the event loop), because they are read from disk or from the network.
/// info
/// note
The example above is actually an exception, because the `io.BytesIO` object is already in memory, so reading it won't block anything.

View File

@@ -81,7 +81,7 @@ If you need to support clients that don't send a `Content-Type` header, you can
With this setting, requests without a `Content-Type` header will have their body parsed as JSON, which is the same behavior as older versions of FastAPI.
/// info
/// note
This behavior and configuration was added in FastAPI 0.132.0.

View File

@@ -111,7 +111,7 @@ They work the same way as for other FastAPI endpoints/*path operations*:
{* ../../docs_src/websockets_/tutorial002_an_py310.py hl[68:69,82] *}
/// info
/// note
As this is a WebSocket it doesn't really make sense to raise an `HTTPException`, instead we raise a `WebSocketException`.

View File

@@ -6,7 +6,7 @@ For that, you can use the `WSGIMiddleware` and use it to wrap your WSGI applicat
## Using `WSGIMiddleware` { #using-wsgimiddleware }
/// info
/// note
This requires installing `a2wsgi` for example with `pip install a2wsgi`.

View File

@@ -36,7 +36,7 @@ Django REST Framework was created by Tom Christie. The same creator of Starlette
///
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Have an automatic API documentation web user interface.
@@ -56,7 +56,7 @@ This decoupling of parts, and being a "microframework" that could be extended to
Given the simplicity of Flask, it seemed like a good match for building APIs. The next thing to find was a "Django REST Framework" for Flask.
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Be a micro-framework. Making it easy to mix and match the tools and parts needed.
@@ -98,7 +98,7 @@ def read_url():
See the similarities in `requests.get(...)` and `@app.get(...)`.
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
* Have a simple and intuitive API.
* Use HTTP method names (operations) directly, in a straightforward and intuitive way.
@@ -118,7 +118,7 @@ At some point, Swagger was given to the Linux Foundation, to be renamed OpenAPI.
That's why when talking about version 2.0 it's common to say "Swagger", and for version 3+ "OpenAPI".
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Adopt and use an open standard for API specifications, instead of a custom schema.
@@ -147,7 +147,7 @@ These features are what Marshmallow was built to provide. It is a great library,
But it was created before there existed Python type hints. So, to define every <dfn title="the definition of how data should be formed">schema</dfn> you need to use specific utils and classes provided by Marshmallow.
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Use code to define "schemas" that provide data types and validation, automatically.
@@ -163,13 +163,13 @@ It uses Marshmallow underneath to do the data validation. And it was created by
It's a great tool and I have used it a lot too, before having **FastAPI**.
/// info
/// note
Webargs was created by the same Marshmallow developers.
///
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Have automatic validation of incoming request data.
@@ -193,13 +193,13 @@ But then, we have again the problem of having a micro-syntax, inside of a Python
The editor can't help much with that. And if we modify parameters or Marshmallow schemas and forget to also modify that YAML docstring, the generated schema would be obsolete.
/// info
/// note
APISpec was created by the same Marshmallow developers.
///
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Support the open standard for APIs, OpenAPI.
@@ -225,13 +225,13 @@ Using it led to the creation of several Flask full-stack generators. These are t
And these same full-stack generators were the base of the [**FastAPI** Project Generators](project-generation.md).
/// info
/// note
Flask-apispec was created by the same Marshmallow developers.
///
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Generate the OpenAPI schema automatically, from the same code that defines serialization and validation.
@@ -251,7 +251,7 @@ But as TypeScript data is not preserved after compilation to JavaScript, it cann
It can't handle nested models very well. So, if the JSON body in the request is a JSON object that has inner fields that in turn are nested JSON objects, it cannot be properly documented and validated.
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Use Python types to have great editor support.
@@ -271,7 +271,7 @@ It clearly inspired Uvicorn and Starlette, that are currently faster than Sanic
///
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Find a way to have a crazy performance.
@@ -287,7 +287,7 @@ It is designed to have functions that receive two parameters, one "request" and
So, data validation, serialization, and documentation, have to be done in code, not automatically. Or they have to be implemented as a framework on top of Falcon, like Hug. This same distinction happens in other frameworks that are inspired by Falcon's design, of having one request object and one response object as parameters.
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Find ways to get great performance.
@@ -313,7 +313,7 @@ The dependency injection system requires pre-registration of the dependencies an
Routes are declared in a single place, using functions declared in other places (instead of using decorators that can be placed right on top of the function that handles the endpoint). This is closer to how Django does it than to how Flask (and Starlette) does it. It separates in the code things that are relatively tightly coupled.
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Define extra validations for data types using the "default" value of model attributes. This improves editor support, and it was not available in Pydantic before.
@@ -335,13 +335,13 @@ It has an interesting, uncommon feature: using the same framework, it's possible
As it is based on the previous standard for synchronous Python web frameworks (WSGI), it can't handle Websockets and other things, although it still has high performance too.
/// info
/// note
Hug was created by Timothy Crosley, the same creator of [`isort`](https://github.com/timothycrosley/isort), a great tool to automatically sort imports in Python files.
///
/// check | Ideas inspiring **FastAPI**
/// tip | Ideas inspiring **FastAPI**
Hug inspired parts of APIStar, and was one of the tools I found most promising, alongside APIStar.
@@ -375,7 +375,7 @@ It was no longer an API web framework, as the creator needed to focus on Starlet
Now APIStar is a set of tools to validate OpenAPI specifications, not a web framework.
/// info
/// note
APIStar was created by Tom Christie. The same guy that created:
@@ -385,7 +385,7 @@ APIStar was created by Tom Christie. The same guy that created:
///
/// check | Inspired **FastAPI** to
/// tip | Inspired **FastAPI** to
Exist.
@@ -409,7 +409,7 @@ That makes it extremely intuitive.
It is comparable to Marshmallow. Although it's faster than Marshmallow in benchmarks. And as it is based on the same Python type hints, the editor support is great.
/// check | **FastAPI** uses it to
/// tip | **FastAPI** uses it to
Handle all the data validation, data serialization and automatic model documentation (based on JSON Schema).
@@ -452,7 +452,7 @@ Nevertheless, it is already being used as a "standard" by several tools. This gr
///
/// check | **FastAPI** uses it to
/// tip | **FastAPI** uses it to
Handle all the core web parts. Adding features on top.
@@ -470,7 +470,7 @@ It is not a web framework, but a server. For example, it doesn't provide tools f
It is the recommended server for Starlette and **FastAPI**.
/// check | **FastAPI** recommends it as
/// tip | **FastAPI** recommends it as
The main web server to run **FastAPI** applications.

View File

@@ -139,7 +139,7 @@ You and your crush eat the burgers and have a nice time. ✨
<img src="/img/async/concurrent-burgers/concurrent-burgers-07.png" class="illustration">
/// info
/// note
Beautiful illustrations by [Ketrina Thompson](https://www.instagram.com/ketrinadrawsalot). 🎨
@@ -205,7 +205,7 @@ You just eat them, and you are done. ⏹
There was not much talk or flirting as most of the time was spent waiting 🕙 in front of the counter. 😞
/// info
/// note
Beautiful illustrations by [Ketrina Thompson](https://www.instagram.com/ketrinadrawsalot). 🎨

View File

@@ -1,267 +1,7 @@
# Development - Contributing
# Contributing
First, you might want to see the basic ways to [help FastAPI and get help](help-fastapi.md).
## Developing
If you already cloned the [fastapi repository](https://github.com/fastapi/fastapi) and you want to deep dive in the code, here are some guidelines to set up your environment.
### Install requirements
Create a virtual environment and install the required packages with [`uv`](https://github.com/astral-sh/uv):
<div class="termy">
```console
$ uv sync --extra all
---> 100%
```
</div>
It will install all the dependencies and your local FastAPI in your local environment.
### Using your local FastAPI
If you create a Python file that imports and uses FastAPI, and run it with the Python from your local environment, it will use your cloned local FastAPI source code.
And if you update that local FastAPI source code when you run that Python file again, it will use the fresh version of FastAPI you just edited.
That way, you don't have to "install" your local version to be able to test every change.
/// note | Technical Details
This only happens when you install using `uv sync --extra all` instead of running `pip install fastapi` directly.
That is because `uv sync --extra all` will install the local version of FastAPI in "editable" mode by default.
///
### Format the code
There is a script that you can run that will format and clean all your code:
<div class="termy">
```console
$ bash scripts/format.sh
```
</div>
It will also auto-sort all your imports.
## Tests
There is a script that you can run locally to test all the code and generate coverage reports in HTML:
<div class="termy">
```console
$ bash scripts/test-cov-html.sh
```
</div>
This command generates a directory `./htmlcov/`, if you open the file `./htmlcov/index.html` in your browser, you can explore interactively the regions of code that are covered by the tests, and notice if there is any region missing.
## Docs
First, make sure you set up your environment as described above, that will install all the requirements.
### Docs live
During local development, there is a script that builds the site and checks for any changes, live-reloading:
<div class="termy">
```console
$ python ./scripts/docs.py live
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
</div>
It will serve the documentation on `http://127.0.0.1:8008`.
That way, you can edit the documentation/source files and see the changes live.
/// tip
Alternatively, you can perform the same steps that scripts does manually.
Go into the language directory, for the main docs in English it's at `docs/en/`:
```console
$ cd docs/en/
```
Then run `mkdocs` in that directory:
```console
$ mkdocs serve --dev-addr 127.0.0.1:8008
```
///
#### Typer CLI (optional)
The instructions here show you how to use the script at `./scripts/docs.py` with the `python` program directly.
But you can also use [Typer CLI](https://typer.tiangolo.com/typer-cli/), and you will get autocompletion in your terminal for the commands after installing completion.
If you install Typer CLI, you can install completion with:
<div class="termy">
```console
$ typer --install-completion
zsh completion installed in /home/user/.bashrc.
Completion will take effect once you restart the terminal.
```
</div>
### Docs Structure
The documentation uses [MkDocs](https://www.mkdocs.org/).
And there are extra tools/scripts in place to handle translations in `./scripts/docs.py`.
/// tip
You don't need to see the code in `./scripts/docs.py`, you just use it in the command line.
///
All the documentation is in Markdown format in the directory `./docs/en/`.
Many of the tutorials have blocks of code.
In most of the cases, these blocks of code are actual complete applications that can be run as is.
In fact, those blocks of code are not written inside the Markdown, they are Python files in the `./docs_src/` directory.
And those Python files are included/injected in the documentation when generating the site.
### Docs for tests
Most of the tests actually run against the example source files in the documentation.
This helps to make sure that:
* The documentation is up-to-date.
* The documentation examples can be run as is.
* Most of the features are covered by the documentation, ensured by test coverage.
#### Apps and docs at the same time
If you run the examples with, e.g.:
<div class="termy">
```console
$ fastapi dev tutorial001.py
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
as Uvicorn by default will use the port `8000`, the documentation on port `8008` won't clash.
### Translations
Help with translations is VERY MUCH appreciated! And it can't be done without the help from the community. 🌎 🚀
Translation pull requests are made by LLMs guided with prompts designed by the FastAPI team together with the community of native speakers for each supported language.
#### LLM Prompt per Language
Each language has a directory: [https://github.com/fastapi/fastapi/tree/master/docs](https://github.com/fastapi/fastapi/tree/master/docs), in it you can see a file `llm-prompt.md` with the prompt specific for that language.
For example, for Spanish, the prompt is at: [`docs/es/llm-prompt.md`](https://github.com/fastapi/fastapi/blob/master/docs/es/llm-prompt.md).
If you see mistakes in your language, you can make suggestions to the prompt in that file for your language, and request the specific pages you would like to re-generate after the changes.
#### Reviewing Translation PRs
We dont require approval from native speakers for translation PRs generated automatically by our translation workflow. However, you can still review them and suggest improvements to the LLM prompt for that language to make the future translations better.
You can check the currently [existing pull requests](https://github.com/fastapi/fastapi/pulls) for your language. You can filter the pull requests by the ones with the label for your language. For example, for Spanish, the label is [`lang-es`](https://github.com/fastapi/fastapi/pulls?q=is%3Aopen+sort%3Aupdated-desc+label%3Alang-es+label%3Aawaiting-review).
You can also review already merged translation PRs. To do this, go to the [closed pull requests](https://github.com/fastapi/fastapi/pulls?q=is%3Apr+is%3Aclosed) and filter by your language label. For example, for Spanish, you can use [`lang-es`](https://github.com/fastapi/fastapi/pulls?q=is%3Apr+is%3Aclosed+label%3Alang-es).
When reviewing a pull request, it's better not to suggest changes in the same pull request, because it is LLM generated, and it won't be possible to make sure that small individual changes are replicated in other similar sections, or that they are preserved when translating the same content again.
Instead of adding suggestions to the translation PR, make the suggestions to the LLM prompt file for that language, in a new PR. For example, for Spanish, the LLM prompt file is at: [`docs/es/llm-prompt.md`](https://github.com/fastapi/fastapi/blob/master/docs/es/llm-prompt.md).
/// tip
Check the docs about [adding a pull request review](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-request-reviews) to approve it or request changes.
///
PRs with suggestions to the language-specific LLM prompt require approval from at least one native speaker. Your help here is very much appreciated!
#### Subscribe to Notifications for Your Language
Check if there's a [GitHub Discussion](https://github.com/fastapi/fastapi/discussions/categories/translations) to coordinate translations for your language. You can subscribe to it, and when there's a new pull request to review, an automatic comment will be added to the discussion.
To check the 2-letter code for the language you want to translate, you can use the table [List of ISO 639-1 codes](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
#### Request a New Language
Let's say that you want to request translations for a language that is not yet translated, not even some pages. For example, Latin.
* The first step would be for you to find other 2 people that would be willing to be reviewing translation PRs for that language with you.
* Once there are at least 3 people that would be willing to commit to help maintain that language, you can continue the next steps.
* Create a new discussion following the template.
* Tag the other 2 people that will help with the language, and ask them to confirm there they will help.
Once there are several people in the discussion, the FastAPI team can evaluate it and can make it an official translation.
Then the docs will be automatically translated using LLMs, and the team of native speakers can review the translation, and help tweak the LLM prompts.
Once there's a new translation, for example if docs are updated or there's a new section, there will be a comment in the same discussion with the link to the new translation to review.
## Automated Code and AI
You are encouraged to use all the tools you want to do your work and contribute as efficiently as possible, this includes AI (LLM) tools, etc. Nevertheless, contributions should have meaningful human intervention, judgement, context, etc.
If the **human effort** put in a PR, e.g. writing LLM prompts, is **less** than the **effort we would need to put** to **review it**, please **don't** submit the PR.
Think of it this way: we can already write LLM prompts or run automated tools ourselves, and that would be faster than reviewing external PRs.
### Closing Automated and AI PRs
If we see PRs that seem AI generated or automated in similar ways, we'll flag them and close them.
The same applies to comments and descriptions, please don't copy paste the content generated by an LLM.
### Human Effort Denial of Service
Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a [Denial-of-service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) on our human effort.
It would be very little effort from the person submitting the PR (an LLM prompt) that generates a large amount of effort on our side (carefully reviewing code).
Please don't do that.
We'll need to block accounts that spam us with repeated automated PRs or comments.
### Use Tools Wisely
As Uncle Ben said:
<blockquote>
With great <strike>power</strike> <strong>tools</strong> comes great responsibility.
</blockquote>
Avoid inadvertently doing harm.
You have amazing tools at hand, use them wisely to help effectively.
To contribute code to the project, please follow the guidelines in [tiangolo.com - Contributing](https://tiangolo.com/open-source/contributing/).

View File

@@ -132,7 +132,7 @@ Successfully installed fastapi pydantic
</div>
/// info
/// note
There are other formats and tools to define and install package dependencies.
@@ -556,7 +556,7 @@ If you are using containers (e.g. Docker, Kubernetes), then there are two main a
If you have **multiple containers**, probably each one running a **single process** (for example, in a **Kubernetes** cluster), then you would probably want to have a **separate container** doing the work of the **previous steps** in a single container, running a single process, **before** running the replicated worker containers.
/// info
/// note
If you are using Kubernetes, this would probably be an [Init Container](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/).

View File

@@ -17,7 +17,7 @@ As you saw in the previous chapter about [Deployment Concepts](concepts.md), the
Here I'll show you how to use **Uvicorn** with **worker processes** using the `fastapi` command or the `uvicorn` command directly.
/// info
/// note
If you are using containers, for example with Docker or Kubernetes, I'll tell you more about that in the next chapter: [FastAPI in Containers - Docker](docker.md).

View File

@@ -1,3 +1,8 @@
---
include_yaml:
topic_repos: data/topic_repos.yml
---
# External Links
**FastAPI** has a great community constantly growing.
@@ -6,7 +11,7 @@ There are many posts, articles, tools, and projects, related to **FastAPI**.
You could easily use a search engine or video platform to find many resources related to FastAPI.
/// info
/// note
Before, this page used to list links to external articles.

View File

@@ -95,7 +95,7 @@ which would be equivalent to:
from backend.main import app
```
### `fastapi dev` with path { #fastapi-dev-with-path }
### `fastapi dev` with path or with `--entrypoint` CLI option { #fastapi-dev-with-path-or-with-entrypoint-cli-option }
You can also pass the file path to the `fastapi dev` command, and it will guess the FastAPI app object to use:
@@ -103,7 +103,13 @@ You can also pass the file path to the `fastapi dev` command, and it will guess
$ fastapi dev main.py
```
But you would have to remember to pass the correct path every time you call the `fastapi` command.
Or, you can also pass the `--entrypoint` option to the `fastapi dev` command:
```console
$ fastapi dev --entrypoint main:app
```
But you would have to remember to pass the correct path\entrypoint every time you call the `fastapi` command.
Additionally, other tools might not be able to find it, for example the [VS Code Extension](editor-support.md) or [FastAPI Cloud](https://fastapicloud.com), so it is recommended to use the `entrypoint` in `pyproject.toml`.

View File

@@ -1,6 +1,16 @@
---
hide:
- navigation
include_yaml:
github_sponsors: data/github_sponsors.yml
people: data/people.yml
contributors: data/contributors.yml
translation_reviewers: data/translation_reviewers.yml
skip_users: data/skip_users.yml
members: data/members.yml
sponsors_badge: data/sponsors_badge.yml
sponsors: data/sponsors.yml
---
# FastAPI People

View File

@@ -63,7 +63,7 @@ second_user_data = {
my_second_user: User = User(**second_user_data)
```
/// info
/// note
`**second_user_data` means:

View File

@@ -1,14 +1,8 @@
# Help FastAPI - Get Help { #help-fastapi-get-help }
# Help { #help }
Do you like **FastAPI**?
Would you like to help FastAPI or get help about FastAPI?
Would you like to help FastAPI, other users, and the author?
Or would you like to get help with **FastAPI**?
There are very simple ways to help (several involve just one or two clicks).
And there are several ways to get help too.
There are very simple ways to help and get help.
## Subscribe to the newsletter { #subscribe-to-the-newsletter }
@@ -20,9 +14,13 @@ You can subscribe to the (infrequent) [**FastAPI and friends** newsletter](newsl
* Breaking changes 🚨
* Tips and tricks ✅
## Follow FastAPI on X (Twitter) { #follow-fastapi-on-x-twitter }
## Follow FastAPI online { #follow-fastapi-online }
[Follow @fastapi on **X (Twitter)**](https://x.com/fastapi) to get the latest news about **FastAPI**. 🐦
You can follow **FastAPI** online in several places:
* [@fastapi on **X / Twitter**](https://x.com/fastapi)
* [@fastapi.tiangolo.com on **Bluesky**](https://bsky.app/profile/fastapi.tiangolo.com)
* [FastAPI on **LinkedIn**](https://www.linkedin.com/company/fastapi/)
## Star **FastAPI** in GitHub { #star-fastapi-in-github }
@@ -38,98 +36,28 @@ There you can select "Releases only".
By doing it, you will receive notifications (in your email) whenever there's a new release (a new version) of **FastAPI** with bug fixes and new features.
## Connect with the author { #connect-with-the-author }
## Follow the author { #follow-the-author }
You can connect with [me (Sebastián Ramírez / `tiangolo`)](https://tiangolo.com), the author.
You can follow [me (Sebastián Ramírez / `tiangolo`)](https://tiangolo.com), the author in a few places, to hear when I have news to share about FastAPI and friends:
You can:
* [Follow me on **GitHub**](https://github.com/tiangolo).
* See other Open Source projects I have created that could help you.
* Follow me to see when I create a new Open Source project.
* [Follow me on **X (Twitter)**](https://x.com/tiangolo) or [Mastodon](https://fosstodon.org/@tiangolo).
* Tell me how you use FastAPI (I love to hear that).
* Hear when I make announcements or release new tools.
* You can also [follow @fastapi on X (Twitter)](https://x.com/fastapi) (a separate account).
* [Follow me on **LinkedIn**](https://www.linkedin.com/in/tiangolo/).
* Hear when I make announcements or release new tools (although I use X (Twitter) more often 🤷‍♂).
* Read what I write (or follow me) on [**Dev.to**](https://dev.to/tiangolo) or [**Medium**](https://medium.com/@tiangolo).
* Read other ideas, articles, and read about tools I have created.
* Follow me to read when I publish something new.
## Tweet about **FastAPI** { #tweet-about-fastapi }
[Tweet about **FastAPI**](https://x.com/compose/tweet?text=I'm loving @fastapi because... https://github.com/fastapi/fastapi) and let me and others know why you like it. 🎉
I love to hear about how **FastAPI** is being used, what you have liked in it, in which project/company are you using it, etc.
## Vote for FastAPI { #vote-for-fastapi }
* [Vote for **FastAPI** in Slant](https://www.slant.co/options/34241/~fastapi-review).
* [Vote for **FastAPI** in AlternativeTo](https://alternativeto.net/software/fastapi/about/).
* [Say you use **FastAPI** on StackShare](https://stackshare.io/pypi-fastapi).
* [@tiangolo on **GitHub**](https://github.com/tiangolo).
* [@tiangolo on **X (Twitter)**](https://x.com/tiangolo)
* [@tiangolo.com on **Bluesky**](https://bsky.app/profile/tiangolo.com)
* [@tiangolo on **LinkedIn**](https://www.linkedin.com/in/tiangolo/).
## Help others with questions in GitHub { #help-others-with-questions-in-github }
You can try and help others with their questions in:
* [GitHub Discussions](https://github.com/fastapi/fastapi/discussions/categories/questions?discussions_q=category%3AQuestions+is%3Aunanswered)
* [GitHub Issues](https://github.com/fastapi/fastapi/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aquestion+-label%3Aanswered+)
You can try and help others with their questions in [GitHub Discussions](https://github.com/fastapi/fastapi/discussions/categories/questions?discussions_q=category%3AQuestions+is%3Aunanswered).
In many cases you might already know the answer for those questions. 🤓
If you are helping a lot of people with their questions, you will become an official [FastAPI Expert](fastapi-people.md#fastapi-experts). 🎉
Just remember, the most important point is: try to be kind. People come with their frustrations and in many cases don't ask in the best way, but try as best as you can to be kind. 🤗
Just remember, the most important point is: try to be kind. 🤗
The idea is for the **FastAPI** community to be kind and welcoming. At the same time, don't accept bullying or disrespectful behavior towards others. We have to take care of each other.
### How to Help { #how-to-help }
---
Here's how to help others with questions (in discussions or issues):
### Understand the question { #understand-the-question }
* Check if you can understand what is the **purpose** and use case of the person asking.
* Then check if the question (the vast majority are questions) is **clear**.
* In many cases the question asked is about an imaginary solution from the user, but there might be a **better** one. If you can understand the problem and use case better, you might be able to suggest a better **alternative solution**.
* If you can't understand the question, ask for more **details**.
### Reproduce the problem { #reproduce-the-problem }
For most of the cases and most of the questions there's something related to the person's **original code**.
In many cases they will only copy a fragment of the code, but that's not enough to **reproduce the problem**.
* You can ask them to provide a [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example), that you can **copy-paste** and run locally to see the same error or behavior they are seeing, or to understand their use case better.
* If you are feeling too generous, you can try to **create an example** like that yourself, just based on the description of the problem. Just keep in mind that this might take a lot of time and it might be better to ask them to clarify the problem first.
### Suggest solutions { #suggest-solutions }
* After being able to understand the question, you can give them a possible **answer**.
* In many cases, it's better to understand their **underlying problem or use case**, because there might be a better way to solve it than what they are trying to do.
### Ask to close { #ask-to-close }
If they reply, there's a high chance you would have solved their problem, congrats, **you're a hero**! 🦸
* Now, if that solved their problem, you can ask them to:
* In GitHub Discussions: mark the comment as the **answer**.
* In GitHub Issues: **close** the issue.
## Watch the GitHub repository { #watch-the-github-repository }
You can "watch" FastAPI in GitHub (clicking the "watch" button at the top right): [https://github.com/fastapi/fastapi](https://github.com/fastapi/fastapi). 👀
If you select "Watching" instead of "Releases only" you will receive notifications when someone creates a new issue or question. You can also specify that you only want to be notified about new issues, or discussions, or PRs, etc.
Then you can try and help them solve those questions.
Follow the [guide on how to help](https://tiangolo.com/open-source/help/#help-others-with-questions-in-github) here.
## Ask Questions { #ask-questions }
@@ -138,119 +66,22 @@ You can [create a new question](https://github.com/fastapi/fastapi/discussions/n
* Ask a **question** or ask about a **problem**.
* Suggest a new **feature**.
**Note**: if you do it, then I'm going to ask you to also help others. 😉
## Review Pull Requests { #review-pull-requests }
You can help me review pull requests from others.
Again, please try your best to be kind. 🤗
---
Here's what to keep in mind and how to review a pull request:
### Understand the problem { #understand-the-problem }
* First, make sure you **understand the problem** that the pull request is trying to solve. It might have a longer discussion in a GitHub Discussion or issue.
* There's also a good chance that the pull request is not actually needed because the problem can be solved in a **different way**. Then you can suggest or ask about that.
### Don't worry about style { #dont-worry-about-style }
* Don't worry too much about things like commit message styles, I will squash and merge customizing the commit manually.
* Also don't worry about style rules, there are already automatized tools checking that.
And if there's any other style or consistency need, I'll ask directly for that, or I'll add commits on top with the needed changes.
### Check the code { #check-the-code }
* Check and read the code, see if it makes sense, **run it locally** and see if it actually solves the problem.
* Then **comment** saying that you did that, that's how I will know you really checked it.
/// info
Unfortunately, I can't simply trust PRs that just have several approvals.
Several times it has happened that there are PRs with 3, 5 or more approvals, probably because the description is appealing, but when I check the PRs, they are actually broken, have a bug, or don't solve the problem they claim to solve. 😅
So, it's really important that you actually read and run the code, and let me know in the comments that you did. 🤓
///
* If the PR can be simplified in a way, you can ask for that, but there's no need to be too picky, there might be a lot of subjective points of view (and I will have my own as well 🙈), so it's better if you can focus on the fundamental things.
### Tests { #tests }
* Help me check that the PR has **tests**.
* Check that the tests **fail** before the PR. 🚨
* Then check that the tests **pass** after the PR. ✅
* Many PRs don't have tests, you can **remind** them to add tests, or you can even **suggest** some tests yourself. That's one of the things that consume most time and you can help a lot with that.
* Then also comment what you tried, that way I'll know that you checked it. 🤓
## Create a Pull Request { #create-a-pull-request }
You can [contribute](contributing.md) to the source code with Pull Requests, for example:
* To fix a typo you found on the documentation.
* To share an article, video, or podcast you created or found about FastAPI by [editing this file](https://github.com/fastapi/fastapi/edit/master/docs/en/data/external_links.yml).
* Make sure you add your link to the start of the corresponding section.
* To help [translate the documentation](contributing.md#translations) to your language.
* You can also help to review the translations created by others.
* To propose new documentation sections.
* To fix an existing issue/bug.
* Make sure to add tests.
* To add a new feature.
* Make sure to add tests.
* Make sure to add documentation if it's relevant.
## Help Maintain FastAPI { #help-maintain-fastapi }
Help me maintain **FastAPI**! 🤓
There's a lot of work to do, and for most of it, **YOU** can do it.
The main tasks that you can do right now are:
* [Help others with questions in GitHub](#help-others-with-questions-in-github) (see the section above).
* [Review Pull Requests](#review-pull-requests) (see the section above).
Those two tasks are what **consume time the most**. That's the main work of maintaining FastAPI.
If you can help me with that, **you are helping me maintain FastAPI** and making sure it keeps **advancing faster and better**. 🚀
## Join the chat { #join-the-chat }
## Join the Chat { #join-the-chat }
Join the 👥 [Discord chat server](https://discord.gg/VQjSZaeJmf) 👥 and hang out with others in the FastAPI community.
/// tip
For questions, ask them in [GitHub Discussions](https://github.com/fastapi/fastapi/discussions/new?category=questions), there's a much better chance you will receive help by the [FastAPI Experts](fastapi-people.md#fastapi-experts).
For questions, ask them in GitHub Discussions, there's a much better chance you will receive help.
Use the chat only for other general conversations.
///
### Don't use the chat for questions { #dont-use-the-chat-for-questions }
### Don't use the Chat for Questions { #dont-use-the-chat-for-questions }
Keep in mind that as chats allow more "free conversation", it's easy to ask questions that are too general and more difficult to answer, so, you might not receive answers.
In GitHub, the template will guide you to write the right question so that you can more easily get a good answer, or even solve the problem yourself even before asking. And in GitHub I can make sure I always answer everything, even if it takes some time. I can't personally do that with the chat systems. 😅
In GitHub, the template will guide you to write the right question so that you can more easily get a good answer, or even solve the problem yourself even before asking.
Conversations in the chat systems are also not as easily searchable as in GitHub, so questions and answers might get lost in the conversation. And only the ones in GitHub count to become a [FastAPI Expert](fastapi-people.md#fastapi-experts), so you will most probably receive more attention in GitHub.
On the other side, there are thousands of users in the chat systems, so there's a high chance you'll find someone to talk to there, almost all the time. 😄
## Sponsor the author { #sponsor-the-author }
If your **product/company** depends on or is related to **FastAPI** and you want to reach its users, you can sponsor the author (me) through [GitHub sponsors](https://github.com/sponsors/tiangolo). Depending on the tier, you could get some extra benefits, like a badge in the docs. 🎁
---
Thanks! 🚀
Conversations in the chat systems are also not as easily searchable as in GitHub, they get lost.

View File

@@ -27,7 +27,7 @@ And that function `get_openapi()` receives as parameters:
* `description`: The description of your API, this can include markdown and will be shown in the docs.
* `routes`: A list of routes, these are each of the registered *path operations*. They are taken from `app.routes`.
/// info
/// note
The parameter `summary` is available in OpenAPI 3.1.0 and above, supported by FastAPI 0.99.0 and above.

View File

@@ -85,7 +85,7 @@ Probably the main use case for this is if you already have some autogenerated cl
In that case, you can disable this feature in **FastAPI**, with the parameter `separate_input_output_schemas=False`.
/// info
/// note
Support for `separate_input_output_schemas` was added in FastAPI `0.102.0`. 🤓

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,3 +1,8 @@
---
include_yaml:
sponsors: data/sponsors.yml
---
# FastAPI { #fastapi }
<style>
@@ -86,16 +91,16 @@ The key features are:
<div class="fastapi-opinions" data-fastapi-opinions>
<div class="fastapi-opinions__tabs" role="tablist" aria-label="Companies using FastAPI">
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-microsoft" aria-controls="fo-panel-microsoft" aria-selected="true" tabindex="0">
<span class="fastapi-opinions__mark"><img src="img/logos/microsoft.svg" alt="Microsoft" loading="lazy"></span>
<span class="fastapi-opinions__mark"><img src="/img/logos/microsoft.svg" alt="Microsoft" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-uber" aria-controls="fo-panel-uber" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="img/logos/uber.svg" alt="Uber" loading="lazy"></span>
<span class="fastapi-opinions__mark"><img src="/img/logos/uber.svg" alt="Uber" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-netflix" aria-controls="fo-panel-netflix" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="img/logos/netflix.svg" alt="Netflix" loading="lazy"></span>
<span class="fastapi-opinions__mark"><img src="/img/logos/netflix.svg" alt="Netflix" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-cisco" aria-controls="fo-panel-cisco" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="img/logos/cisco.svg" alt="Cisco" loading="lazy"></span>
<span class="fastapi-opinions__mark"><img src="/img/logos/cisco.svg" alt="Cisco" loading="lazy"></span>
</button>
</div>

View File

@@ -1,165 +0,0 @@
# Repository Management Tasks
These are the tasks that can be performed to manage the FastAPI repository by [team members](./fastapi-people.md#team).
/// tip
This section is useful only to a handful of people, team members with permissions to manage the repository. You can probably skip it. 😉
///
...so, you are a [team member of FastAPI](./fastapi-people.md#team)? Wow, you are so cool! 😎
You can help with everything on [Help FastAPI - Get Help](./help-fastapi.md) the same ways as external contributors. But additionally, there are some tasks that only you (as part of the team) can perform.
Here are the general instructions for the tasks you can perform.
Thanks a lot for your help. 🙇
## Be Nice
First of all, be nice. 😊
You probably are super nice if you were added to the team, but it's worth mentioning it. 🤓
### When Things are Difficult
When things are great, everything is easier, so that doesn't need much instructions. But when things are difficult, here are some guidelines.
Try to find the good side. In general, if people are not being unfriendly, try to thank their effort and interest, even if you disagree with the main subject (discussion, PR), just thank them for being interested in the project, or for having dedicated some time to try to do something.
It's difficult to convey emotion in text, use emojis to help. 😅
In discussions and PRs, in many cases, people bring their frustration and show it without filter, in many cases exaggerating, complaining, being entitled, etc. That's really not nice, and when it happens, it lowers our priority to solve their problems. But still, try to breath, and be gentle with your answers.
Try to avoid using bitter sarcasm or potentially passive-aggressive comments. If something is wrong, it's better to be direct (try to be gentle) than sarcastic.
Try to be as specific and objective as possible, avoid generalizations.
For conversations that are more difficult, for example to reject a PR, you can ask me (@tiangolo) to handle it directly.
## Edit PR Titles
* Edit the PR title to start with an emoji from [gitmoji](https://gitmoji.dev/).
* Use the emoji character, not the GitHub code. So, use `🐛` instead of `:bug:`. This is so that it shows up correctly outside of GitHub, for example in the release notes.
* For translations use the `🌐` emoji ("globe with meridians").
* Start the title with a verb. For example `Add`, `Refactor`, `Fix`, etc. This way the title will say the action that the PR does. Like `Add support for teleporting`, instead of `Teleporting wasn't working, so this PR fixes it`.
* Edit the text of the PR title to start in "imperative", like giving an order. So, instead of `Adding support for teleporting` use `Add support for teleporting`.
* Try to make the title descriptive about what it achieves. If it's a feature, try to describe it, for example `Add support for teleporting` instead of `Create TeleportAdapter class`.
* Do not finish the title with a period (`.`).
* When the PR is for a translation, start with the `🌐` and then `Add {language} translation for` and then the translated file path. For example:
```Markdown
🌐 Add Spanish translation for `docs/es/docs/teleporting.md`
```
Once the PR is merged, a GitHub Action ([latest-changes](https://github.com/tiangolo/latest-changes)) will use the PR title to update the latest changes automatically.
So, having a nice PR title will not only look nice in GitHub, but also in the release notes. 📝
## Add Labels to PRs
The same GitHub Action [latest-changes](https://github.com/tiangolo/latest-changes) uses one label in the PR to decide the section in the release notes to put this PR in.
Make sure you use a supported label from the [latest-changes list of labels](https://github.com/tiangolo/latest-changes#using-labels):
* `breaking`: Breaking Changes
* Existing code will break if they update the version without changing their code. This rarely happens, so this label is not frequently used.
* `security`: Security Fixes
* This is for security fixes, like vulnerabilities. It would almost never be used.
* `feature`: Features
* New features, adding support for things that didn't exist before.
* `bug`: Fixes
* Something that was supported didn't work, and this fixes it. There are many PRs that claim to be bug fixes because the user is doing something in an unexpected way that is not supported, but they considered it what should be supported by default. Many of these are actually features or refactors. But in some cases there's an actual bug.
* `refactor`: Refactors
* This is normally for changes to the internal code that don't change the behavior. Normally it improves maintainability, or enables future features, etc.
* `upgrade`: Upgrades
* This is for upgrades to direct dependencies from the project, or extra optional dependencies, normally in `pyproject.toml`. So, things that would affect final users, they would end up receiving the upgrade in their code base once they update. But this is not for upgrades to internal dependencies used for development, testing, docs, etc. Those internal dependencies or GitHub Action versions should be marked as `internal`, not `upgrade`.
* `docs`: Docs
* Changes in docs. This includes updating the docs, fixing typos. But it doesn't include changes to translations.
* You can normally quickly detect it by going to the "Files changed" tab in the PR and checking if the updated file(s) starts with `docs/en/docs`. The original version of the docs is always in English, so in `docs/en/docs`.
* `lang-all`: Translations
* Use this for translations. You can normally quickly detect it by going to the "Files changed" tab in the PR and checking if the updated file(s) starts with `docs/{some lang}/docs` but not `docs/en/docs`. For example, `docs/es/docs`.
* `internal`: Internal
* Use this for changes that only affect how the repo is managed. For example upgrades to internal dependencies, changes in GitHub Actions or scripts, etc.
/// tip
Some tools like Dependabot, will add some labels, like `dependencies`, but have in mind that this label is not used by the `latest-changes` GitHub Action, so it won't be used in the release notes. Please make sure one of the labels above is added.
///
## Add Labels to Translation PRs
When there's a PR for a translation, apart from adding the `lang-all` label, also add a label for the language.
There will be a label for each language using the language code, like `lang-{lang code}`, for example, `lang-es` for Spanish, `lang-fr` for French, etc.
* Add the specific language label.
* Add the label `awaiting-review`.
The label `awaiting-review` is special, only used for translations. A GitHub Action will detect it, then it will read the language label, and it will update the GitHub Discussions managing the translations for that language to notify people that there's a new translation to review.
Once a native speaker comes, reviews the PR, and approves it, the GitHub Action will come and remove the `awaiting-review` label, and add the `approved-1` label.
This way, we can notice when there are new translations ready, because they have the `approved-1` label.
## Merge Translation PRs
Translations are generated automatically with LLMs and scripts.
There's one GitHub Action that can be manually run to add or update translations for a language: [`translate.yml`](https://github.com/fastapi/fastapi/actions/workflows/translate.yml).
For these language translation PRs, confirm that:
* The PR was automated (authored by @tiangolo), not made by another user.
* It has the labels `lang-all` and `lang-{lang code}`.
For PRs that update language-specific LLM prompts, confirm that:
* The PR has the labels `lang-all` and `lang-{lang code}`.
* It is approved by at least one native speaker.
* In some cases you might need to translate several pages with new prompt to make sure it works as expected.
If the PR meets the above conditions, you can merge it. 😎
## Review PRs
* If a PR doesn't explain what it does or why, if it seems like it could be useful, ask for more information. Otherwise, feel free to close it.
* If a PR seems to be spam, meaningless, only to change statistics (to appear as "contributor") or similar, you can simply mark it as `invalid`, and it will be automatically closed.
* If a PR seems to be AI generated, and seems like reviewing it would take more time from you than the time it took to write the prompt, mark it as `maybe-ai`, and it will be automatically closed.
* A PR should have a specific use case that it is solving.
* If the PR is for a feature, it should have docs.
* Unless it's a feature we want to discourage, like support for a corner case that we don't want users to use.
* The docs should include a source example file, not write Python directly in Markdown.
* If the source example(s) file can have different syntax for different Python versions, there should be different versions of the file, and they should be shown in tabs in the docs.
* There should be tests testing the source example.
* Before the PR is applied, the new tests should fail.
* After applying the PR, the new tests should pass.
* Coverage should stay at 100%.
* If you see the PR makes sense, or we discussed it and considered it should be accepted, you can add commits on top of the PR to tweak it, to add docs, tests, format, refactor, remove extra files, etc.
* Feel free to comment in the PR to ask for more information, to suggest changes, etc.
* Once you think the PR is ready, move it in the internal GitHub project for me to review it.
## FastAPI People PRs
Every month, a GitHub Action updates the FastAPI People data. Those PRs look like this one: [👥 Update FastAPI People](https://github.com/fastapi/fastapi/pull/11669).
If the tests are passing, you can merge it right away.
## Dependabot PRs
Dependabot will create PRs to update dependencies for several things, and those PRs all look similar, but some are way more delicate than others.
* If the PR is for a direct dependency, so, Dependabot is modifying `pyproject.toml` in the main dependencies, **don't merge it**. 😱 Let me check it first. There's a good chance that some additional tweaks or updates are needed.
* If the PR updates one of the internal dependencies, for example the group `dev` in `pyproject.toml`, or GitHub Action versions, if the tests are passing, the release notes (shown in a summary in the PR) don't show any obvious potential breaking change, you can merge it. 😎
## Mark GitHub Discussions Answers
When a question in GitHub Discussions has been answered, mark the answer by clicking "Mark as answer".
You can filter discussions by [`Questions` that are `Unanswered`](https://github.com/tiangolo/fastapi/discussions/categories/questions?discussions_q=category:Questions+is:open+is:unanswered).

View File

@@ -12,19 +12,7 @@ I normally give the final review to each PR before merging them. I make the fina
There's a team of people that help manage and maintain the project. 😎
They have different levels of permissions and [specific instructions](./management-tasks.md).
Some of the tasks they can perform include:
* Adding labels to PRs.
* Editing PR titles.
* Adding commits on top of PRs to tweak them.
* Mark answers in GitHub Discussions questions, etc.
* Merge some specific types of PRs.
You can see the current team members in [FastAPI People - Team](./fastapi-people.md#team).
Joining the team is by invitation only, and I could update or remove permissions, instructions, or membership.
Learn more about it in [tiangolo.com - GitHub FastAPI](https://tiangolo.com/github-fastapi/).
## FastAPI Experts
@@ -32,8 +20,6 @@ The people that help others the most in GitHub Discussions can become [**FastAPI
This is normally the best way to contribute to the project.
## External Contributions
## External Help
External contributions are very welcome and appreciated, including answering questions, submitting PRs, etc. 🙇‍♂
There are many ways to [help maintain FastAPI](./help-fastapi.md#help-maintain-fastapi).
External help is very much appreciated. There are many ways to [help](./help-fastapi.md). ☕

View File

@@ -172,7 +172,7 @@ As the list is a type that contains some internal types, you put them in square
{* ../../docs_src/python_types/tutorial006_py310.py hl[1] *}
/// info
/// note
Those internal types in the square brackets are called "type parameters".
@@ -283,7 +283,7 @@ An example from the official Pydantic docs:
{* ../../docs_src/python_types/tutorial011_py310.py *}
/// info
/// note
To learn more about [Pydantic, check its docs](https://docs.pydantic.dev/).
@@ -341,7 +341,7 @@ This might all sound abstract. Don't worry. You'll see all this in action in the
The important thing is that by using standard Python types, in a single place (instead of adding more classes, decorators, etc), **FastAPI** will do a lot of the work for you.
/// info
/// note
If you already went through all the tutorial and came back to see more about types, a good resource is [the "cheat sheet" from `mypy`](https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html).

View File

@@ -7,8 +7,21 @@ hide:
## Latest Changes
## 0.136.2 (2026-05-23)
### Refactors
* ♻️ Validate Server Sent Event fields to avoid applications from sending broken data. PR [#15588](https://github.com/fastapi/fastapi/pull/15588) by [@tiangolo](https://github.com/tiangolo).
### Docs
* 📝 Document `--entrypoint` CLI option. PR [#15464](https://github.com/fastapi/fastapi/pull/15464) by [@YuriiMotov](https://github.com/YuriiMotov).
* 📝 Update and simplify docs about help and management. PR [#15583](https://github.com/fastapi/fastapi/pull/15583) by [@tiangolo](https://github.com/tiangolo).
* 📝 Add docs references to central contributing docs. PR [#15580](https://github.com/fastapi/fastapi/pull/15580) by [@tiangolo](https://github.com/tiangolo).
* 📝 Update security policy. PR [#15577](https://github.com/fastapi/fastapi/pull/15577) by [@tiangolo](https://github.com/tiangolo).
* 🍱 Update sponsors: TalorData image. PR [#15562](https://github.com/fastapi/fastapi/pull/15562) by [@tiangolo](https://github.com/tiangolo).
* 📝 Update docs, simplify usage of admonitions, only default ones. PR [#15553](https://github.com/fastapi/fastapi/pull/15553) by [@tiangolo](https://github.com/tiangolo).
* 📝 Fix image URLs in `index.md`. PR [#15534](https://github.com/fastapi/fastapi/pull/15534) by [@YuriiMotov](https://github.com/YuriiMotov).
* ✏️ Fix Azkaban spelling typo in `virtual-environments.md`. PR [#15463](https://github.com/fastapi/fastapi/pull/15463) by [@isaacbernat](https://github.com/isaacbernat).
* 💄 Improve layout and styling. PR [#15462](https://github.com/fastapi/fastapi/pull/15462) by [@alejsdev](https://github.com/alejsdev).
* 💄 Refactor opinions section with interactive tabs and new logos. PR [#15458](https://github.com/fastapi/fastapi/pull/15458) by [@alejsdev](https://github.com/alejsdev).
@@ -16,10 +29,35 @@ hide:
### Translations
* 🌐 Improve translation consistency in `docs/pt/docs/advanced/generate-clients.md`. PR [#15456](https://github.com/fastapi/fastapi/pull/15456) by [@Will-thom](https://github.com/Will-thom).
* 🌐 Update translations for ja (update-outdated). PR [#15530](https://github.com/fastapi/fastapi/pull/15530) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for uk (update-outdated). PR [#15529](https://github.com/fastapi/fastapi/pull/15529) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for pt (update-outdated). PR [#15528](https://github.com/fastapi/fastapi/pull/15528) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for de (update-outdated). PR [#15527](https://github.com/fastapi/fastapi/pull/15527) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for tr (update-outdated). PR [#15526](https://github.com/fastapi/fastapi/pull/15526) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for ko (update-outdated). PR [#15525](https://github.com/fastapi/fastapi/pull/15525) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for zh-hant (update-outdated). PR [#15524](https://github.com/fastapi/fastapi/pull/15524) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for fr (update-outdated). PR [#15522](https://github.com/fastapi/fastapi/pull/15522) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for es (update-outdated). PR [#15523](https://github.com/fastapi/fastapi/pull/15523) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for zh (update-outdated). PR [#15520](https://github.com/fastapi/fastapi/pull/15520) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translations for ru (update-outdated). PR [#15521](https://github.com/fastapi/fastapi/pull/15521) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Fix typos in Spanish LLM-prompt. PR [#15472](https://github.com/fastapi/fastapi/pull/15472) by [@crr004](https://github.com/crr004).
### Internal
* ✅ Update tests, don't double dispose the engine. PR [#15587](https://github.com/fastapi/fastapi/pull/15587) by [@tiangolo](https://github.com/tiangolo).
* ⚡️ Speed up test suite via caching and fixture scopes to make it ~24% faster. PR [#13583](https://github.com/fastapi/fastapi/pull/13583) by [@dikos1337](https://github.com/dikos1337).
* 🔥 Remove config files now in central GitHub repo. PR [#15585](https://github.com/fastapi/fastapi/pull/15585) by [@tiangolo](https://github.com/tiangolo).
* ⬆ Bump urllib3 from 2.6.3 to 2.7.0. PR [#15502](https://github.com/fastapi/fastapi/pull/15502) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump idna from 3.11 to 3.15. PR [#15565](https://github.com/fastapi/fastapi/pull/15565) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump cloudflare/wrangler-action from 3.15.0 to 4.0.0. PR [#15571](https://github.com/fastapi/fastapi/pull/15571) by [@dependabot[bot]](https://github.com/apps/dependabot).
* 🔧 Migrate docs from MkDocs to Zensical. PR [#15563](https://github.com/fastapi/fastapi/pull/15563) by [@tiangolo](https://github.com/tiangolo).
* 🔒️ Only allow team members to modify dependencies. PR [#15548](https://github.com/fastapi/fastapi/pull/15548) by [@svlandeg](https://github.com/svlandeg).
* ⬆ Bump actions/add-to-project from 1.0.2 to 2.0.0. PR [#15490](https://github.com/fastapi/fastapi/pull/15490) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump actions/labeler from 6.0.1 to 6.1.0. PR [#15507](https://github.com/fastapi/fastapi/pull/15507) by [@dependabot[bot]](https://github.com/apps/dependabot).
* 🔧 Remove Ruff ignored rule for tabs. PR [#15533](https://github.com/fastapi/fastapi/pull/15533) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Update sponsors badge. PR [#15532](https://github.com/fastapi/fastapi/pull/15532) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Add sponsor: TalorData. PR [#15531](https://github.com/fastapi/fastapi/pull/15531) by [@tiangolo](https://github.com/tiangolo).
* ⬆ Bump ty from 0.0.21 to 0.0.34. PR [#15443](https://github.com/fastapi/fastapi/pull/15443) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump pydantic from 2.13.2 to 2.13.3. PR [#15444](https://github.com/fastapi/fastapi/pull/15444) by [@dependabot[bot]](https://github.com/apps/dependabot).
* 👷 Add pre-commit to check typos. PR [#15482](https://github.com/fastapi/fastapi/pull/15482) by [@tiangolo](https://github.com/tiangolo).

View File

@@ -0,0 +1,28 @@
# Translations
Translation pull requests are made by LLMs guided with prompts designed by the FastAPI team together with the community of native speakers for each supported language.
## LLM Prompt per Language
Each language has a directory: [https://github.com/fastapi/fastapi/tree/master/docs](https://github.com/fastapi/fastapi/tree/master/docs), in it you can see a file `llm-prompt.md` with the prompt specific for that language.
For example, for Spanish, the prompt is at: [`docs/es/llm-prompt.md`](https://github.com/fastapi/fastapi/blob/master/docs/es/llm-prompt.md).
If you see mistakes in your language, you can make suggestions to the prompt in that file for your language, and request the specific pages you would like to re-generate after the changes.
PRs with suggestions to the language-specific LLM prompt require approval from at least one native speaker. Your help here is very much appreciated!
## Request a New Language
Let's say that you want to request translations for a language that is not yet translated, not even some pages. For example, Latin.
* The first step would be for you to find other 2 people that would be willing to be reviewing translation PRs for that language with you.
* Once there are at least 3 people that would be willing to commit to help maintain that language, you can continue the next steps.
* Create a new discussion following the template.
* Tag the other 2 people that will help with the language, and ask them to confirm there they will help.
Once there are several people in the discussion, the FastAPI team can evaluate it and can make it an official translation.
Then the docs will be automatically translated using LLMs, and the team of native speakers can review the translation, and help tweak the LLM prompts.
Once there's a new translation, for example if docs are updated or there's a new section, there will be a comment in the same discussion with the link to the new translation to review.

View File

@@ -4,7 +4,7 @@ If you are building an application or a web API, it's rarely the case that you c
**FastAPI** provides a convenience tool to structure your application while keeping all the flexibility.
/// info
/// note
If you come from Flask, this would be the equivalent of Flask's Blueprints.
@@ -194,7 +194,7 @@ Having `dependencies` in the `APIRouter` can be used, for example, to require au
///
/// check
/// tip
The `prefix`, `tags`, `responses`, and `dependencies` parameters are (as in many other cases) just a feature from **FastAPI** to help you avoid code duplication.
@@ -339,7 +339,7 @@ We could also import them like:
from app.routers import items, users
```
/// info
/// note
The first version is a "relative import":
@@ -382,7 +382,7 @@ Now, let's include the `router`s from the submodules `users` and `items`:
{* ../../docs_src/bigger_applications/app_an_py310/main.py hl[10:11] title["app/main.py"] *}
/// info
/// note
`users.router` contains the `APIRouter` inside of the file `app/routers/users.py`.
@@ -402,7 +402,7 @@ So, behind the scenes, it will actually work as if everything was the same singl
///
/// check
/// tip
You don't have to worry about performance when including routers.
@@ -451,7 +451,7 @@ Here we do it... just to show that we can 🤷:
and it will work correctly, together with all the other *path operations* added with `app.include_router()`.
/// info | Very Technical Details
/// note | Very Technical Details
**Note**: this is a very technical detail that you probably can **just skip**.

View File

@@ -111,7 +111,7 @@ For example:
{* ../../docs_src/body_multiple_params/tutorial004_an_py310.py hl[28] *}
/// info
/// note
`Body` also has all the same extra validation and metadata parameters as `Query`, `Path` and others you will see later.

View File

@@ -136,7 +136,7 @@ This will expect (convert, validate, document, etc.) a JSON body like:
}
```
/// info
/// note
Notice how the `images` key now has a list of image objects.
@@ -148,7 +148,7 @@ You can define arbitrarily deeply nested models:
{* ../../docs_src/body_nested_models/tutorial007_py310.py hl[7,12,18,21,25] *}
/// info
/// note
Notice how `Offer` has a list of `Item`s, which in turn have an optional list of `Image`s

View File

@@ -8,7 +8,7 @@ Your API almost always has to send a **response** body. But clients don't necess
To declare a **request** body, you use [Pydantic](https://docs.pydantic.dev/) models with all their power and benefits.
/// info
/// note
To send data, you should use one of: `POST` (the more common), `PUT`, `DELETE` or `PATCH`.

View File

@@ -32,7 +32,7 @@ You can see the defined cookies in the docs UI at `/docs`:
<img src="/img/tutorial/cookie-param-models/image01.png">
</div>
/// info
/// note
Have in mind that, as **browsers handle cookies** in special ways and behind the scenes, they **don't** easily allow **JavaScript** to touch them.

View File

@@ -24,13 +24,13 @@ But remember that when you import `Query`, `Path`, `Cookie` and others from `fas
///
/// info
/// note
To declare cookies, you need to use `Cookie`, because otherwise the parameters would be interpreted as query parameters.
///
/// info
/// note
Have in mind that, as **browsers handle cookies** in special ways and behind the scenes, they **don't** easily allow **JavaScript** to touch them.

View File

@@ -72,7 +72,7 @@ So, the line:
will not be executed.
/// info
/// note
For more information, check [the official Python docs](https://docs.python.org/3/library/__main__.html).

View File

@@ -28,7 +28,7 @@ It might also help avoid confusion for new developers that see an unused paramet
///
/// info
/// note
In this example we use invented custom headers `X-Key` and `X-Token`.

View File

@@ -170,7 +170,7 @@ participant tasks as Background tasks
end
```
/// info
/// note
Only **one response** will be sent to the client. It might be one of the error responses or it will be the response from the *path operation*.

View File

@@ -51,7 +51,7 @@ In this case, this dependency expects:
And then it just returns a `dict` containing those values.
/// info
/// note
FastAPI added support for `Annotated` (and started recommending it) in version 0.95.0.
@@ -106,7 +106,7 @@ common_parameters --> read_users
This way you write shared code once and **FastAPI** takes care of calling it for your *path operations*.
/// check
/// tip
Notice that you don't have to create a special class and pass it somewhere to **FastAPI** to "register" it or anything similar.

View File

@@ -35,7 +35,7 @@ Then we can use the dependency with:
{* ../../docs_src/dependencies/tutorial005_an_py310.py hl[23] *}
/// info
/// note
Notice that we are only declaring one dependency in the *path operation function*, the `query_or_cookie_extractor`.

View File

@@ -180,7 +180,7 @@ which would be equivalent to:
from backend.main import app
```
### `fastapi dev` with path { #fastapi-dev-with-path }
### `fastapi dev` with path or with `--entrypoint` CLI option { #fastapi-dev-with-path-or-with-entrypoint-cli-option }
You can also pass the file path to the `fastapi dev` command, and it will guess the FastAPI app object to use:
@@ -188,7 +188,13 @@ You can also pass the file path to the `fastapi dev` command, and it will guess
$ fastapi dev main.py
```
But you would have to remember to pass the correct path every time you call the `fastapi` command.
Or, you can also pass the `--entrypoint` option to the `fastapi dev` command:
```console
$ fastapi dev --entrypoint main:app
```
But you would have to remember to pass the correct path\entrypoint every time you call the `fastapi` command.
Additionally, other tools might not be able to find it, for example the [VS Code Extension](../editor-support.md) or [FastAPI Cloud](https://fastapicloud.com), so it is recommended to use the `entrypoint` in `pyproject.toml`.
@@ -270,7 +276,7 @@ https://example.com/items/foo
/items/foo
```
/// info
/// note
A "path" is also commonly called an "endpoint" or a "route".
@@ -322,7 +328,7 @@ The `@app.get("/")` tells **FastAPI** that the function right below is in charge
* the path `/`
* using a <dfn title="an HTTP GET method"><code>get</code> operation</dfn>
/// info | `@decorator` Info
/// note | `@decorator` Info
That `@something` syntax in Python is called a "decorator".

View File

@@ -24,7 +24,7 @@ But remember that when you import `Query`, `Path`, `Header`, and others from `fa
///
/// info
/// note
To declare headers, you need to use `Header`, because otherwise the parameters would be interpreted as query parameters.

View File

@@ -74,7 +74,7 @@ Use the `tags` parameter with your *path operations* (and `APIRouter`s) to assig
{* ../../docs_src/metadata/tutorial004_py310.py hl[21,26] *}
/// info
/// note
Read more about tags in [Path Operation Configuration](path-operation-configuration.md#tags).

View File

@@ -72,13 +72,13 @@ You can specify the response description with the parameter `response_descriptio
{* ../../docs_src/path_operation_configuration/tutorial005_py310.py hl[18] *}
/// info
/// note
Notice that `response_description` refers specifically to the response, the `description` refers to the *path operation* in general.
///
/// check
/// tip
OpenAPI specifies that each *path operation* requires a response description.

View File

@@ -8,7 +8,7 @@ First, import `Path` from `fastapi`, and import `Annotated`:
{* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[1,3] *}
/// info
/// note
FastAPI added support for `Annotated` (and started recommending it) in version 0.95.0.
@@ -131,7 +131,7 @@ And you can also declare numeric validations:
* `lt`: `l`ess `t`han
* `le`: `l`ess than or `e`qual
/// info
/// note
`Query`, `Path`, and other classes you will see later are subclasses of a common `Param` class.

View File

@@ -20,7 +20,7 @@ You can declare the type of a path parameter in the function, using standard Pyt
In this case, `item_id` is declared to be an `int`.
/// check
/// tip
This will give you editor support inside of your function, with error checks, completion, etc.
@@ -34,7 +34,7 @@ If you run this example and open your browser at [http://127.0.0.1:8000/items/3]
{"item_id":3}
```
/// check
/// tip
Notice that the value your function received (and returned) is `3`, as a Python `int`, not a string `"3"`.
@@ -66,7 +66,7 @@ because the path parameter `item_id` had a value of `"foo"`, which is not an `in
The same error would appear if you provided a `float` instead of an `int`, as in: [http://127.0.0.1:8000/items/4.2](http://127.0.0.1:8000/items/4.2)
/// check
/// tip
So, with the same Python type declaration, **FastAPI** gives you data validation.
@@ -82,7 +82,7 @@ And when you open your browser at [http://127.0.0.1:8000/docs](http://127.0.0.1:
<img src="/img/tutorial/path-params/image01.png">
/// check
/// tip
Again, just with that same Python type declaration, **FastAPI** gives you automatic, interactive documentation (integrating Swagger UI).

View File

@@ -29,7 +29,7 @@ To achieve that, first import:
{* ../../docs_src/query_params_str_validations/tutorial002_an_py310.py hl[1,3] *}
/// info
/// note
FastAPI added support for `Annotated` (and started recommending it) in version 0.95.0.
@@ -382,7 +382,7 @@ For example, this custom validator checks that the item ID starts with `isbn-` f
{* ../../docs_src/query_params_str_validations/tutorial015_an_py310.py hl[5,16:19,24] *}
/// info
/// note
This is available with Pydantic version 2 or above. 😎

View File

@@ -65,7 +65,7 @@ The same way, you can declare optional query parameters, by setting their defaul
In this case, the function parameter `q` will be optional, and will be `None` by default.
/// check
/// tip
Also notice that **FastAPI** is smart enough to notice that the path parameter `item_id` is a path parameter and `q` is not, so, it's a query parameter.

View File

@@ -2,7 +2,7 @@
You can define files to be uploaded by the client using `File`.
/// info
/// note
To receive uploaded files, first install [`python-multipart`](https://github.com/Kludex/python-multipart).
@@ -28,7 +28,7 @@ Create file parameters the same way you would for `Body` or `Form`:
{* ../../docs_src/request_files/tutorial001_an_py310.py hl[9] *}
/// info
/// note
`File` is a class that inherits directly from `Form`.

View File

@@ -2,7 +2,7 @@
You can use **Pydantic models** to declare **form fields** in FastAPI.
/// info
/// note
To use forms, first install [`python-multipart`](https://github.com/Kludex/python-multipart).

View File

@@ -2,7 +2,7 @@
You can define files and form fields at the same time using `File` and `Form`.
/// info
/// note
To receive uploaded files and/or form data, first install [`python-multipart`](https://github.com/Kludex/python-multipart).

View File

@@ -2,7 +2,7 @@
When you need to receive form fields instead of JSON, you can use `Form`.
/// info
/// note
To use forms, first install [`python-multipart`](https://github.com/Kludex/python-multipart).
@@ -32,7 +32,7 @@ The <dfn title="specification">spec</dfn> requires the fields to be exactly name
With `Form` you can declare the same configurations as with `Body` (and `Query`, `Path`, `Cookie`), including validation, examples, an alias (e.g. `user-name` instead of `username`), etc.
/// info
/// note
`Form` is a class that inherits directly from `Body`.

View File

@@ -72,7 +72,7 @@ Here we are declaring a `UserIn` model, it will contain a plaintext password:
{* ../../docs_src/response_model/tutorial002_py310.py hl[7,9] *}
/// info
/// note
To use `EmailStr`, first install [`email-validator`](https://github.com/JoshData/python-email-validator).
@@ -251,7 +251,7 @@ So, if you send a request to that *path operation* for the item with ID `foo`, t
}
```
/// info
/// note
You can also use:

View File

@@ -18,7 +18,7 @@ Notice that `status_code` is a parameter of the "decorator" method (`get`, `post
The `status_code` parameter receives a number with the HTTP status code.
/// info
/// note
`status_code` can alternatively also receive an `IntEnum`, such as Python's [`http.HTTPStatus`](https://docs.python.org/3/library/http.html#http.HTTPStatus).

View File

@@ -24,7 +24,7 @@ For example you could use it to add metadata for a frontend user interface, etc.
///
/// info
/// note
OpenAPI 3.1.0 (used since FastAPI 0.99.0) added support for `examples`, which is part of the **JSON Schema** standard.
@@ -155,7 +155,7 @@ OpenAPI also added `example` and `examples` fields to other parts of the specifi
* `File()`
* `Form()`
/// info
/// note
This old OpenAPI-specific `examples` parameter is now `openapi_examples` since FastAPI `0.103.0`.
@@ -171,7 +171,7 @@ And now this new `examples` field takes precedence over the old single (and cust
This new `examples` field in JSON Schema is **just a `list`** of examples, not a dict with extra metadata as in the other places in OpenAPI (described above).
/// info
/// note
Even after OpenAPI 3.1.0 was released with this new simpler integration with JSON Schema, for a while, Swagger UI, the tool that provides the automatic docs, didn't support OpenAPI 3.1.0 (it does since version 5.0.0 🎉).

View File

@@ -24,7 +24,7 @@ Copy the example in a file `main.py`:
## Run it { #run-it }
/// info
/// note
The [`python-multipart`](https://github.com/Kludex/python-multipart) package is automatically installed with **FastAPI** when you run the `pip install "fastapi[standard]"` command.
@@ -60,7 +60,7 @@ You will see something like this:
<img src="/img/tutorial/security/image01.png">
/// check | Authorize button!
/// tip | Authorize button!
You already have a shiny new "Authorize" button.
@@ -118,7 +118,7 @@ So, let's review it from that simplified point of view:
In this example we are going to use **OAuth2**, with the **Password** flow, using a **Bearer** token. We do that using the `OAuth2PasswordBearer` class.
/// info
/// note
A "bearer" token is not the only option.
@@ -148,7 +148,7 @@ This parameter doesn't create that endpoint / *path operation*, but declares tha
We will soon also create the actual path operation.
/// info
/// note
If you are a very strict "Pythonista" you might dislike the style of the parameter name `tokenUrl` instead of `token_url`.
@@ -176,7 +176,7 @@ This dependency will provide a `str` that is assigned to the parameter `token` o
**FastAPI** will know that it can use this dependency to define a "security scheme" in the OpenAPI schema (and the automatic API docs).
/// info | Technical Details
/// note | Technical Details
**FastAPI** will know that it can use the class `OAuth2PasswordBearer` (declared in a dependency) to define the security scheme in OpenAPI because it inherits from `fastapi.security.oauth2.OAuth2`, which in turn inherits from `fastapi.security.base.SecurityBase`.

View File

@@ -52,7 +52,7 @@ Here **FastAPI** won't get confused because you are using `Depends`.
///
/// check
/// tip
The way this dependency system is designed allows us to have different dependencies (different "dependables") that all return a `User` model.

View File

@@ -42,7 +42,7 @@ $ pip install pyjwt
</div>
/// info
/// note
If you are planning to use digital signature algorithms like RSA or ECDSA, you should install the cryptography library dependency `pyjwt[crypto]`.
@@ -213,7 +213,7 @@ Using the credentials:
Username: `johndoe`
Password: `secret`
/// check
/// tip
Notice that nowhere in the code is the plaintext password "`secret`", we only have the hashed version.

View File

@@ -32,7 +32,7 @@ They are normally used to declare specific security permissions, for example:
* `instagram_basic` is used by Facebook / Instagram.
* `https://www.googleapis.com/auth/drive` is used by Google.
/// info
/// note
In OAuth2 a "scope" is just a string that declares a specific permission required.
@@ -72,7 +72,7 @@ If you need to enforce it, use `OAuth2PasswordRequestFormStrict` instead of `OAu
* An optional `client_id` (we don't need it for our example).
* An optional `client_secret` (we don't need it for our example).
/// info
/// note
The `OAuth2PasswordRequestForm` is not a special class for **FastAPI** as is `OAuth2PasswordBearer`.
@@ -144,7 +144,7 @@ UserInDB(
)
```
/// info
/// note
For a more complete explanation of `**user_dict` check back in [the documentation for **Extra Models**](../extra-models.md#about-user-in-dict).
@@ -196,7 +196,7 @@ So, in our endpoint, we will only get a user if the user exists, was correctly a
{* ../../docs_src/security/tutorial003_an_py310.py hl[58:66,69:74,94] *}
/// info
/// note
The additional header `WWW-Authenticate` with value `Bearer` we are returning here is also part of the spec.

View File

@@ -4,7 +4,7 @@ You can stream data to the client using **Server-Sent Events** (SSE).
This is similar to [Stream JSON Lines](stream-json-lines.md), but uses the `text/event-stream` format, which is supported natively by browsers with the [`EventSource` API](https://developer.mozilla.org/en-US/docs/Web/API/EventSource).
/// info
/// note
Added in FastAPI 0.135.0.

View File

@@ -2,7 +2,7 @@
You could have a sequence of data that you would like to send in a "**stream**", you could do it with **JSON Lines**.
/// info
/// note
Added in FastAPI 0.134.0.
@@ -48,7 +48,7 @@ A response would have a content type of `application/jsonl` (instead of `applica
It's very similar to a JSON array (equivalent of a Python list), but instead of being wrapped in `[]` and having `,` between the items, it has **one JSON object per line**, they are separated by a new line character.
/// info
/// note
The important point is that your app will be able to produce each line in turn, while the client consumes the previous lines.

View File

@@ -8,7 +8,7 @@ With it, you can use [pytest](https://docs.pytest.org/) directly with **FastAPI*
## Using `TestClient` { #using-testclient }
/// info
/// note
To use `TestClient`, first install [`httpx`](https://www.python-httpx.org).
@@ -144,7 +144,7 @@ E.g.:
For more information about how to pass data to the backend (using `httpx` or the `TestClient`) check the [HTTPX documentation](https://www.python-httpx.org).
/// info
/// note
Note that the `TestClient` receives data that can be converted to JSON, not Pydantic models.

View File

@@ -2,7 +2,7 @@
When you work in Python projects you probably should use a **virtual environment** (or a similar mechanism) to isolate the packages you install for each project.
/// info
/// note
If you already know about virtual environments, how to create them and use them, you might want to skip this section. 🤓
@@ -18,7 +18,7 @@ A **virtual environment** is a directory with some files in it.
///
/// info
/// note
This page will teach you how to use **virtual environments** and how they work.

View File

@@ -1,5 +0,0 @@
# Define this here and not in the main mkdocs.yml file because that one is auto
# updated and written, and the script would remove the env var
markdown_extensions:
pymdownx.highlight:
linenums: !ENV [LINENUMS, false]

View File

@@ -1,10 +1,10 @@
INHERIT: ../en/mkdocs.env.yml
site_name: FastAPI
site_description: FastAPI framework, high performance, easy to learn, fast to code, ready for production
site_url: https://fastapi.tiangolo.com/
theme:
variant: classic
name: material
custom_dir: ../en/overrides
custom_dir: overrides
palette:
- media: (prefers-color-scheme)
toggle:
@@ -45,38 +45,13 @@ theme:
- search.suggest
- toc.follow
icon:
repo: fontawesome/brands/github-alt
repo: octicons/mark-github-24
logo: img/icon-white.svg
favicon: img/favicon.png
language: en
repo_name: fastapi/fastapi
repo_url: https://github.com/fastapi/fastapi
plugins:
social:
cards_layout_options:
logo: ../en/docs/img/icon-white.svg
typeset: null
search: null
macros:
include_yaml:
- github_sponsors: ../en/data/github_sponsors.yml
- people: ../en/data/people.yml
- contributors: ../en/data/contributors.yml
- translators: ../en/data/translators.yml
- translation_reviewers: ../en/data/translation_reviewers.yml
- skip_users: ../en/data/skip_users.yml
- members: ../en/data/members.yml
- sponsors_badge: ../en/data/sponsors_badge.yml
- sponsors: ../en/data/sponsors.yml
- topic_repos: ../en/data/topic_repos.yml
redirects:
redirect_maps:
deployment/deta.md: deployment/cloud.md
advanced/graphql.md: how-to/graphql.md
advanced/custom-request-and-route.md: how-to/custom-request-and-route.md
advanced/conditional-openapi.md: how-to/conditional-openapi.md
advanced/extending-openapi.md: how-to/extending-openapi.md
advanced/testing-database.md: how-to/testing-database.md
mkdocstrings:
handlers:
python:
@@ -102,13 +77,13 @@ plugins:
nav:
- FastAPI: index.md
- features.md
- Learn:
- "":
- learn/index.md
- python-types.md
- async.md
- environment-variables.md
- virtual-environments.md
- Tutorial - User Guide:
- "":
- tutorial/index.md
- tutorial/first-steps.md
- tutorial/path-params.md
@@ -137,14 +112,14 @@ nav:
- tutorial/path-operation-configuration.md
- tutorial/encoder.md
- tutorial/body-updates.md
- Dependencies:
- "":
- tutorial/dependencies/index.md
- tutorial/dependencies/classes-as-dependencies.md
- tutorial/dependencies/sub-dependencies.md
- tutorial/dependencies/dependencies-in-path-operation-decorators.md
- tutorial/dependencies/global-dependencies.md
- tutorial/dependencies/dependencies-with-yield.md
- Security:
- "":
- tutorial/security/index.md
- tutorial/security/first-steps.md
- tutorial/security/get-current-user.md
@@ -161,7 +136,7 @@ nav:
- tutorial/static-files.md
- tutorial/testing.md
- tutorial/debugging.md
- Advanced User Guide:
- "":
- advanced/index.md
- advanced/stream-data.md
- advanced/path-operation-advanced-configuration.md
@@ -173,7 +148,7 @@ nav:
- advanced/response-headers.md
- advanced/response-change-status-code.md
- advanced/advanced-dependencies.md
- Advanced Security:
- "":
- advanced/security/index.md
- advanced/security/oauth2-scopes.md
- advanced/security/http-basic-auth.md
@@ -199,7 +174,7 @@ nav:
- advanced/strict-content-type.md
- fastapi-cli.md
- editor-support.md
- Deployment:
- "":
- deployment/index.md
- deployment/versions.md
- deployment/fastapicloud.md
@@ -209,7 +184,7 @@ nav:
- deployment/cloud.md
- deployment/server-workers.md
- deployment/docker.md
- How To - Recipes:
- "":
- how-to/index.md
- how-to/general.md
- how-to/migrate-from-pydantic-v1-to-pydantic-v2.md
@@ -222,7 +197,7 @@ nav:
- how-to/configure-swagger-ui.md
- how-to/testing-database.md
- how-to/authentication-error-status-code.md
- Reference (Code API):
- "":
- reference/index.md
- reference/fastapi.md
- reference/parameters.md
@@ -238,7 +213,7 @@ nav:
- reference/response.md
- reference/responses.md
- reference/middleware.md
- OpenAPI:
- "":
- reference/openapi/index.md
- reference/openapi/docs.md
- reference/openapi/models.md
@@ -248,15 +223,15 @@ nav:
- reference/templating.md
- reference/testclient.md
- fastapi-people.md
- Resources:
- "":
- resources/index.md
- help-fastapi.md
- contributing.md
- translations.md
- project-generation.md
- external-links.md
- newsletter.md
- management-tasks.md
- About:
- "":
- about/index.md
- alternatives.md
- history-design-future.md
@@ -264,10 +239,7 @@ nav:
- management.md
- release-notes.md
markdown_extensions:
material.extensions.preview:
targets:
include:
- '*'
zensical.extensions.macros: null
abbr: null
attr_list: null
footnotes: null
@@ -290,7 +262,10 @@ markdown_extensions:
format: !!python/name:pymdownx.superfences.fence_code_format ''
pymdownx.tilde: null
pymdownx.blocks.admonition:
# TODO: remove types section (with custom types) once translations are migrated to
# not use custom types too
types:
# Default types
- note
- attention
- caution
@@ -299,6 +274,7 @@ markdown_extensions:
- tip
- hint
- warning
# Custom types
- info
- check
pymdownx.blocks.details: null
@@ -308,16 +284,16 @@ markdown_extensions:
markdown_include_variants: null
extra:
social:
- icon: fontawesome/brands/github-alt
- icon: octicons/mark-github-24
link: https://github.com/fastapi/fastapi
- icon: fontawesome/brands/discord
link: https://discord.gg/VQjSZaeJmf
- icon: fontawesome/brands/twitter
- icon: fontawesome/brands/x-twitter
link: https://x.com/fastapi
- icon: fontawesome/brands/bluesky
link: https://bsky.app/profile/fastapi.tiangolo.com
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/company/fastapi
- icon: fontawesome/solid/globe
link: https://tiangolo.com
alternate:
- link: /
name: en - English
@@ -350,5 +326,5 @@ extra_javascript:
- js/termynal.js
- js/custom.js
- js/init_kapa_widget.js
hooks:
- ../../scripts/mkdocs_hooks.py
validation:
unresolved_references: false

View File

@@ -4,8 +4,8 @@
</div>
{% if not config.extra.generator == false %}
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
<a href="https://zensical.org" target="_blank" rel="noopener">
Zensical
</a>
{% endif %}
</div>

View File

@@ -30,7 +30,6 @@ Su sponsorship también demuestra un fuerte compromiso con la **comunidad** de F
Por ejemplo, podrías querer probar:
* [Speakeasy](https://speakeasy.com/editor?utm_source=fastapi+repo&utm_medium=github+sponsorship)
* [Stainless](https://www.stainless.com/?utm_source=fastapi&utm_medium=referral)
* [liblab](https://developers.liblab.com/tutorials/sdk-for-fastapi?utm_source=fastapi)

View File

@@ -1,3 +1,8 @@
---
include_yaml:
sponsors: data/sponsors.yml
---
# FastAPI { #fastapi }
<style>
@@ -54,18 +59,27 @@ Las funcionalidades clave son:
### Sponsor Keystone { #keystone-sponsor }
<div class="fastapi-sponsors fastapi-sponsors--keystone">
{% for sponsor in sponsors.keystone -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--keystone" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}"></a>
{% endfor -%}
</div>
### Sponsors Oro y Plata { #gold-and-silver-sponsors }
### Sponsors Oro { #gold-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--gold">
{% for sponsor in sponsors.gold -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--gold" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor -%}
{%- for sponsor in sponsors.silver -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
</div>
### Sponsors Plata { #silver-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--silver">
{% for sponsor in sponsors.silver -%}
<a class="fastapi-sponsors__card fastapi-sponsors__card--silver" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor %}
</div>
<!-- /sponsors -->
@@ -73,7 +87,45 @@ Las funcionalidades clave son:
## Opiniones { #opinions }
"_[...] Estoy usando **FastAPI** un montón estos días. [...] De hecho, estoy planeando usarlo para todos los servicios de **ML de mi equipo en Microsoft**. Algunos de ellos se están integrando en el núcleo del producto **Windows** y algunos productos de **Office**._"
<!-- only-mkdocs -->
<div class="fastapi-opinions" data-fastapi-opinions>
<div class="fastapi-opinions__tabs" role="tablist" aria-label="Companies using FastAPI">
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-microsoft" aria-controls="fo-panel-microsoft" aria-selected="true" tabindex="0">
<span class="fastapi-opinions__mark"><img src="/img/logos/microsoft.svg" alt="Microsoft" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-uber" aria-controls="fo-panel-uber" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/uber.svg" alt="Uber" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-netflix" aria-controls="fo-panel-netflix" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/netflix.svg" alt="Netflix" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-cisco" aria-controls="fo-panel-cisco" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/cisco.svg" alt="Cisco" loading="lazy"></span>
</button>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-microsoft" role="tabpanel" aria-labelledby="fo-tab-microsoft" tabindex="0">
<blockquote class="fastapi-opinions__quote">"Estoy usando <strong>FastAPI</strong> un montón estos días. De hecho, estoy planeando usarlo para todos los <strong>servicios de ML de mi equipo en Microsoft</strong>. Algunos de ellos se están integrando en el producto principal de <strong>Windows</strong> y algunos productos de <strong>Office</strong>."</blockquote>
<div class="fastapi-opinions__attr">— Kabir Khan, <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-uber" role="tabpanel" aria-labelledby="fo-tab-uber" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">"Adoptamos el paquete <strong>FastAPI</strong> para crear un servidor <strong>REST</strong> que pueda ser consultado para obtener <strong>predicciones</strong>." <em>[para Ludwig]</em></blockquote>
<div class="fastapi-opinions__attr">— Piero Molino, Yaroslav Dudin, Sai Sumanth Miryala, <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-netflix" role="tabpanel" aria-labelledby="fo-tab-netflix" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">"<strong>Netflix</strong> se complace en anunciar el lanzamiento open source de nuestro framework de orquestación de <strong>gestión de crisis</strong>: <strong>Dispatch</strong>!" <em>[construido con FastAPI]</em></blockquote>
<div class="fastapi-opinions__attr">— Kevin Glisson, Marc Vilanova, Forest Monsen, <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-cisco" role="tabpanel" aria-labelledby="fo-tab-cisco" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">"Si alguien está buscando construir una API de Python para producción, recomendaría altamente <strong>FastAPI</strong>. Está <strong>hermosamente diseñado</strong>, es <strong>simple de usar</strong> y <strong>altamente escalable</strong> — se ha convertido en un <strong>componente clave</strong> en nuestra estrategia de desarrollo API primero."</blockquote>
<div class="fastapi-opinions__attr">— Deon Pillsbury, <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/">(ref)</a></div>
</div>
</div>
<!-- /only-mkdocs -->
<div class="only-github" markdown="1">
"_[...] Estoy usando **FastAPI** un montón estos días. [...] De hecho, estoy planeando usarlo para todos los **servicios de ML de mi equipo en Microsoft**. Algunos de ellos se están integrando en el núcleo del producto **Windows** y algunos productos de **Office**._"
<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26"><small>(ref)</small></a></div>
@@ -81,47 +133,35 @@ Las funcionalidades clave son:
"_Adoptamos el paquete **FastAPI** para crear un servidor **REST** que pueda ser consultado para obtener **predicciones**. [para Ludwig]_"
<div style="text-align: right; margin-right: 10%;">Piero Molino, Yaroslav Dudin, y Sai Sumanth Miryala - <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/"><small>(ref)</small></a></div>
<div style="text-align: right; margin-right: 10%;">Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/"><small>(ref)</small></a></div>
---
"_**Netflix** se complace en anunciar el lanzamiento de código abierto de nuestro framework de orquestación de **gestión de crisis**: **Dispatch**! [construido con **FastAPI**]_"
"_**Netflix** se complace en anunciar el lanzamiento open source de nuestro framework de orquestación de **gestión de crisis**: **Dispatch**! [construido con **FastAPI**]_"
<div style="text-align: right; margin-right: 10%;">Kevin Glisson, Marc Vilanova, Forest Monsen - <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072"><small>(ref)</small></a></div>
---
"_Estoy súper emocionado con **FastAPI**. ¡Es tan divertido!_"
<div style="text-align: right; margin-right: 10%;">Brian Okken - <strong>[Python Bytes](https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855) host del podcast</strong> <a href="https://x.com/brianokken/status/1112220079972728832"><small>(ref)</small></a></div>
---
"_Honestamente, lo que has construido parece súper sólido y pulido. En muchos aspectos, es lo que quería que **Hug** fuera; es realmente inspirador ver a alguien construir eso._"
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong>[Hug](https://github.com/hugapi/hug) creador</strong> <a href="https://news.ycombinator.com/item?id=19455465"><small>(ref)</small></a></div>
---
"_Si estás buscando aprender un **framework moderno** para construir APIs REST, échale un vistazo a **FastAPI** [...] Es rápido, fácil de usar y fácil de aprender [...]_"
"_Nos hemos cambiado a **FastAPI** para nuestras **APIs** [...] Creo que te gustará [...]_"
<div style="text-align: right; margin-right: 10%;">Ines Montani - Matthew Honnibal - <strong>[fundadores de Explosion AI](https://explosion.ai) - [creadores de spaCy](https://spacy.io)</strong> <a href="https://x.com/_inesmontani/status/1144173225322143744"><small>(ref)</small></a> - <a href="https://x.com/honnibal/status/1144031421859655680"><small>(ref)</small></a></div>
---
"_Si alguien está buscando construir una API de Python para producción, altamente recomendaría **FastAPI**. Está **hermosamente diseñado**, es **simple de usar** y **altamente escalable**, se ha convertido en un **componente clave** en nuestra estrategia de desarrollo API primero y está impulsando muchas automatizaciones y servicios como nuestro Ingeniero Virtual TAC._"
"_Si alguien está buscando construir una API de Python para producción, recomendaría altamente **FastAPI**. Es**hermosamente diseñado**, es **simple de usar** y **altamente escalable**, se ha convertido en un **componente clave** en nuestra estrategia de desarrollo API primero y está impulsando muchas automatizaciones y servicios como nuestro Ingeniero Virtual TAC._"
<div style="text-align: right; margin-right: 10%;">Deon Pillsbury - <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/"><small>(ref)</small></a></div>
---
</div>
## FastAPI Conf { #fastapi-conf }
[**FastAPI Conf '26**](https://fastapiconf.com) se llevará a cabo el **28 de octubre de 2026** en **Ámsterdam, NL**. Todo sobre FastAPI, directo de la fuente. 🎤
<a class="fastapi-feature-banner" href="https://fastapiconf.com"><img src="https://fastapi.tiangolo.com/img/fastapi-conf.jpeg" alt="FastAPI Conf '26 - October 28, 2026 - Amsterdam, NL"></a>
## Mini documental de FastAPI { #fastapi-mini-documentary }
Hay un [mini documental de FastAPI](https://www.youtube.com/watch?v=mpR8ngthqiE) lanzado a finales de 2025, puedes verlo online:
<a href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>
<a class="fastapi-feature-banner" href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>
## **Typer**, el FastAPI de las CLIs { #typer-the-fastapi-of-clis }
@@ -245,7 +285,7 @@ Puedes leer más sobre esto en la [documentación del CLI de FastAPI](https://fa
</details>
### Revísalo { #check-it }
### Revisa { #check-it }
Abre tu navegador en [http://127.0.0.1:8000/items/5?q=somequery](http://127.0.0.1:8000/items/5?q=somequery).
@@ -258,7 +298,7 @@ Verás el response JSON como:
Ya creaste una API que:
* Recibe requests HTTP en los _paths_ `/` y `/items/{item_id}`.
* Ambos _paths_ toman _operaciones_ `GET` (también conocidas como métodos HTTP).
* Ambos _paths_ toman `GET` <em>operaciones</em> (también conocidas como _métodos_ HTTP).
* El _path_ `/items/{item_id}` tiene un _parámetro de path_ `item_id` que debe ser un `int`.
* El _path_ `/items/{item_id}` tiene un _parámetro de query_ `q` opcional que es un `str`.

View File

@@ -166,7 +166,7 @@ $ source .venv/Scripts/activate
Cada vez que instales un **nuevo paquete** en ese entorno, **activa** el entorno de nuevo.
Esto asegura que si usas un programa de **terminal (<abbr title="command line interface interfaz de línea de comandos">CLI</abbr>)** instalado por ese paquete, uses el de tu entorno virtual y no cualquier otro que podría estar instalado globalmente, probablemente con una versión diferente a la que necesitas.
Esto asegura que si usas un **programa de terminal (<abbr title="command line interface - interfaz de línea de comandos">CLI</abbr>)** instalado por ese paquete, uses el de tu entorno virtual y no cualquier otro que podría estar instalado globalmente, probablemente con una versión diferente a la que necesitas.
///
@@ -817,7 +817,7 @@ Traceback (most recent call last):
</div>
Pero si desactivas el entorno virtual y activas el nuevo para `prisoner-of-askaban` entonces cuando ejecutes `python` utilizará el Python del entorno virtual en `prisoner-of-azkaban`.
Pero si desactivas el entorno virtual y activas el nuevo para `prisoner-of-azkaban` entonces cuando ejecutes `python` utilizará el Python del entorno virtual en `prisoner-of-azkaban`.
<div class="termy">

View File

@@ -1 +0,0 @@
INHERIT: ../en/mkdocs.yml

View File

@@ -30,7 +30,6 @@ Leur sponsoring démontre également un fort engagement envers la **communauté*
Par exemple, vous pourriez essayer :
* [Speakeasy](https://speakeasy.com/editor?utm_source=fastapi+repo&utm_medium=github+sponsorship)
* [Stainless](https://www.stainless.com/?utm_source=fastapi&utm_medium=referral)
* [liblab](https://developers.liblab.com/tutorials/sdk-for-fastapi?utm_source=fastapi)

View File

@@ -1,3 +1,8 @@
---
include_yaml:
sponsors: data/sponsors.yml
---
# FastAPI { #fastapi }
<style>
@@ -54,18 +59,27 @@ Les principales fonctionnalités sont :
### Sponsor clé de voûte { #keystone-sponsor }
<div class="fastapi-sponsors fastapi-sponsors--keystone">
{% for sponsor in sponsors.keystone -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--keystone" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}"></a>
{% endfor -%}
</div>
### Sponsors Or et Argent { #gold-and-silver-sponsors }
### Sponsors Or { #gold-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--gold">
{% for sponsor in sponsors.gold -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--gold" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor -%}
{%- for sponsor in sponsors.silver -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
</div>
### Sponsors Argent { #silver-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--silver">
{% for sponsor in sponsors.silver -%}
<a class="fastapi-sponsors__card fastapi-sponsors__card--silver" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor %}
</div>
<!-- /sponsors -->
@@ -73,55 +87,81 @@ Les principales fonctionnalités sont :
## Opinions { #opinions }
« _[...] J'utilise beaucoup **FastAPI** ces derniers temps. [...] Je prévois de l'utiliser dans mon équipe pour tous les **services de ML chez Microsoft**. Certains d'entre eux sont intégrés au cœur de **Windows** et à certains produits **Office**._ »
<!-- only-mkdocs -->
<div class="fastapi-opinions" data-fastapi-opinions>
<div class="fastapi-opinions__tabs" role="tablist" aria-label="Entreprises utilisant FastAPI">
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-microsoft" aria-controls="fo-panel-microsoft" aria-selected="true" tabindex="0">
<span class="fastapi-opinions__mark"><img src="/img/logos/microsoft.svg" alt="Microsoft" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-uber" aria-controls="fo-panel-uber" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/uber.svg" alt="Uber" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-netflix" aria-controls="fo-panel-netflix" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/netflix.svg" alt="Netflix" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-cisco" aria-controls="fo-panel-cisco" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/cisco.svg" alt="Cisco" loading="lazy"></span>
</button>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-microsoft" role="tabpanel" aria-labelledby="fo-tab-microsoft" tabindex="0">
<blockquote class="fastapi-opinions__quote">« J'utilise énormément <strong>FastAPI</strong> ces derniers temps. Je prévois de l'utiliser pour tous les <strong>services de ML chez Microsoft</strong> de mon équipe. Certains d'entre eux sont intégrés au cœur de <strong>Windows</strong> et à certains produits <strong>Office</strong>. »</blockquote>
<div class="fastapi-opinions__attr">— Kabir Khan, <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-uber" role="tabpanel" aria-labelledby="fo-tab-uber" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">« Nous avons adopté la bibliothèque <strong>FastAPI</strong> pour lancer un serveur <strong>REST</strong> qui peut être interrogé pour obtenir des <strong>prédictions</strong>. » <em>[pour Ludwig]</em></blockquote>
<div class="fastapi-opinions__attr">— Piero Molino, Yaroslav Dudin, Sai Sumanth Miryala, <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-netflix" role="tabpanel" aria-labelledby="fo-tab-netflix" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">« <strong>Netflix</strong> est heureux dannoncer la publication en open source de notre framework dorchestration de <strong>gestion de crise</strong> : <strong>Dispatch</strong> ! » <em>[construit avec FastAPI]</em></blockquote>
<div class="fastapi-opinions__attr">— Kevin Glisson, Marc Vilanova, Forest Monsen, <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-cisco" role="tabpanel" aria-labelledby="fo-tab-cisco" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">« Si quelquun cherche à construire une API Python de production, je recommande vivement <strong>FastAPI</strong>. Il est <strong>magnifiquement conçu</strong>, <strong>simple à utiliser</strong> et <strong>hautement scalable</strong> — il est devenu un <strong>composant clé</strong> de notre stratégie de développement API-first. »</blockquote>
<div class="fastapi-opinions__attr">— Deon Pillsbury, <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/">(ref)</a></div>
</div>
</div>
<!-- /only-mkdocs -->
<div class="only-github" markdown="1">
« _[...] J'utilise **FastAPI** énormément ces derniers temps. [...] Je prévois de l'utiliser pour tous les **services de ML chez Microsoft** de mon équipe. Certains d'entre eux sont intégrés au cœur de **Windows** et à certains produits **Office**._ »
<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26"><small>(ref)</small></a></div>
---
« _Nous avons adopté la bibliothèque **FastAPI** pour créer un serveur **REST** qui peut être interrogé pour obtenir des **prédictions**. [pour Ludwig]_ »
« _Nous avons adopté la bibliothèque **FastAPI** pour lancer un serveur **REST** qui peut être interrogé pour obtenir des **prédictions**. [pour Ludwig]_ »
<div style="text-align: right; margin-right: 10%;">Piero Molino, Yaroslav Dudin, et Sai Sumanth Miryala - <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/"><small>(ref)</small></a></div>
---
« _**Netflix** est heureux d'annoncer la publication en open source de notre framework d'orchestration de **gestion de crise** : **Dispatch** ! [construit avec **FastAPI**]_ »
« _**Netflix** est heureux dannoncer la publication en open source de notre framework dorchestration de **gestion de crise** : **Dispatch** ! [construit avec **FastAPI**]_ »
<div style="text-align: right; margin-right: 10%;">Kevin Glisson, Marc Vilanova, Forest Monsen - <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072"><small>(ref)</small></a></div>
---
« _Je suis plus qu'enthousiaste à propos de **FastAPI**. C'est tellement fun !_ »
<div style="text-align: right; margin-right: 10%;">Brian Okken - <strong>Animateur du podcast [Python Bytes](https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855)</strong> <a href="https://x.com/brianokken/status/1112220079972728832"><small>(ref)</small></a></div>
---
« _Honnêtement, ce que vous avez construit a l'air super solide et soigné. À bien des égards, c'est ce que je voulais que **Hug** soit — c'est vraiment inspirant de voir quelqu'un construire ça._ »
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong>Créateur de [Hug](https://github.com/hugapi/hug)</strong> <a href="https://news.ycombinator.com/item?id=19455465"><small>(ref)</small></a></div>
---
« _Si vous cherchez à apprendre un **framework moderne** pour créer des APIs REST, regardez **FastAPI** [...] C'est rapide, facile à utiliser et facile à apprendre [...]_ »
« _Nous sommes passés à **FastAPI** pour nos **APIs** [...] Je pense que vous l'aimerez [...]_ »
<div style="text-align: right; margin-right: 10%;">Ines Montani - Matthew Honnibal - <strong>Fondateurs de [Explosion AI](https://explosion.ai) - Créateurs de [spaCy](https://spacy.io)</strong> <a href="https://x.com/_inesmontani/status/1144173225322143744"><small>(ref)</small></a> - <a href="https://x.com/honnibal/status/1144031421859655680"><small>(ref)</small></a></div>
---
« _Si quelqu'un cherche à construire une API Python de production, je recommande vivement **FastAPI**. Il est **magnifiquement conçu**, **simple à utiliser** et **hautement scalable**. Il est devenu un **composant clé** de notre stratégie de développement API-first et alimente de nombreuses automatisations et services tels que notre ingénieur TAC virtuel._ »
« _Si quelquun cherche à construire une API Python de production, je recommande vivement **FastAPI**. Il est **magnifiquement conçu**, **simple à utiliser** et **hautement scalable** — il est devenu un **composant clé** de notre stratégie de développement API-first._ »
<div style="text-align: right; margin-right: 10%;">Deon Pillsbury - <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/"><small>(ref)</small></a></div>
---
</div>
## FastAPI Conf { #fastapi-conf }
[**FastAPI Conf '26**](https://fastapiconf.com) aura lieu le **28 octobre 2026** à **Amsterdam, NL**. Tout sur FastAPI, à la source. 🎤
<a class="fastapi-feature-banner" href="https://fastapiconf.com"><img src="https://fastapi.tiangolo.com/img/fastapi-conf.jpeg" alt="FastAPI Conf '26 - 28 octobre 2026 - Amsterdam, NL"></a>
## Mini documentaire FastAPI { #fastapi-mini-documentary }
Un [mini documentaire FastAPI](https://www.youtube.com/watch?v=mpR8ngthqiE) est sorti fin 2025, vous pouvez le regarder en ligne :
<a href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>
<a class="fastapi-feature-banner" href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>
## **Typer**, le FastAPI des CLIs { #typer-the-fastapi-of-clis }

View File

@@ -819,7 +819,7 @@ Traceback (most recent call last):
</div>
Mais si vous désactivez lenvironnement virtuel et activez le nouveau pour `prisoner-of-askaban`, alors lorsque vous exécuterez `python`, il utilisera le Python de lenvironnement virtuel de `prisoner-of-azkaban`.
Mais si vous désactivez lenvironnement virtuel et activez le nouveau pour `prisoner-of-azkaban`, alors lorsque vous exécuterez `python`, il utilisera le Python de lenvironnement virtuel de `prisoner-of-azkaban`.
<div class="termy">

View File

@@ -1 +0,0 @@
INHERIT: ../en/mkdocs.yml

View File

@@ -30,7 +30,6 @@ FastAPI は自動的に **OpenAPI 3.1** の仕様を生成します。したが
例えば、次のようなものがあります:
* [Speakeasy](https://speakeasy.com/editor?utm_source=fastapi+repo&utm_medium=github+sponsorship)
* [Stainless](https://www.stainless.com/?utm_source=fastapi&utm_medium=referral)
* [liblab](https://developers.liblab.com/tutorials/sdk-for-fastapi?utm_source=fastapi)

View File

@@ -1,3 +1,8 @@
---
include_yaml:
sponsors: data/sponsors.yml
---
# FastAPI { #fastapi }
<style>
@@ -54,18 +59,27 @@ FastAPI は、Python の標準である型ヒントに基づいて Python で AP
### Keystone Sponsor { #keystone-sponsor }
<div class="fastapi-sponsors fastapi-sponsors--keystone">
{% for sponsor in sponsors.keystone -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--keystone" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}"></a>
{% endfor -%}
</div>
### Gold and Silver Sponsors { #gold-and-silver-sponsors }
### Gold Sponsors { #gold-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--gold">
{% for sponsor in sponsors.gold -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--gold" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor -%}
{%- for sponsor in sponsors.silver -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
</div>
### Silver Sponsors { #silver-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--silver">
{% for sponsor in sponsors.silver -%}
<a class="fastapi-sponsors__card fastapi-sponsors__card--silver" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor %}
</div>
<!-- /sponsors -->
@@ -73,6 +87,44 @@ FastAPI は、Python の標準である型ヒントに基づいて Python で AP
## 評価 { #opinions }
<!-- only-mkdocs -->
<div class="fastapi-opinions" data-fastapi-opinions>
<div class="fastapi-opinions__tabs" role="tablist" aria-label="Companies using FastAPI">
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-microsoft" aria-controls="fo-panel-microsoft" aria-selected="true" tabindex="0">
<span class="fastapi-opinions__mark"><img src="/img/logos/microsoft.svg" alt="Microsoft" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-uber" aria-controls="fo-panel-uber" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/uber.svg" alt="Uber" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-netflix" aria-controls="fo-panel-netflix" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/netflix.svg" alt="Netflix" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-cisco" aria-controls="fo-panel-cisco" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/cisco.svg" alt="Cisco" loading="lazy"></span>
</button>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-microsoft" role="tabpanel" aria-labelledby="fo-tab-microsoft" tabindex="0">
<blockquote class="fastapi-opinions__quote">「最近は **FastAPI** をたくさん使っています。実際、私のチームの **Microsoft の ML サービス** 全てで使用する予定です。そのいくつかはコアな **Windows** 製品や **Office** 製品に統合されつつあります。」</blockquote>
<div class="fastapi-opinions__attr">— Kabir Khan, <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-uber" role="tabpanel" aria-labelledby="fo-tab-uber" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">「**FastAPI** ライブラリを採用し、クエリで **予測値** を取得できる **REST** サーバを構築しました。」<em>[for Ludwig]</em></blockquote>
<div class="fastapi-opinions__attr">— Piero Molino, Yaroslav Dudin, Sai Sumanth Miryala, <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-netflix" role="tabpanel" aria-labelledby="fo-tab-netflix" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">「<strong>Netflix</strong> は、私たちの <strong>危機管理</strong> オーケストレーションフレームワーク、<strong>Dispatch</strong> のオープンソースリリースを発表できることをうれしく思います!」<em>[built with FastAPI]</em></blockquote>
<div class="fastapi-opinions__attr">— Kevin Glisson, Marc Vilanova, Forest Monsen, <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-cisco" role="tabpanel" aria-labelledby="fo-tab-cisco" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">「本番の Python API を構築したい方には、**FastAPI** を強くおすすめします。**美しく設計**され、**使いやすく**、**高いスケーラビリティ**があります。私たちの API ファースト開発戦略の **主要コンポーネント** となりました。」</blockquote>
<div class="fastapi-opinions__attr">— Deon Pillsbury, <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/">(ref)</a></div>
</div>
</div>
<!-- /only-mkdocs -->
<div class="only-github" markdown="1">
"_[...] 最近 **FastAPI** を使っています。 [...] 実際に私のチームの全ての **Microsoft の機械学習サービス** で使用する予定です。 そのうちのいくつかのコアな **Windows** 製品と **Office** 製品に統合されつつあります。_"
<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26"><small>(ref)</small></a></div>
@@ -91,37 +143,25 @@ FastAPI は、Python の標準である型ヒントに基づいて Python で AP
---
"_私は **FastAPI** にワクワクしています。 めちゃくちゃ楽しいです_"
<div style="text-align: right; margin-right: 10%;">Brian Okken - <strong>[Python Bytes](https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855) podcast host</strong> <a href="https://x.com/brianokken/status/1112220079972728832"><small>(ref)</small></a></div>
---
"_正直、あなたが作ったものは超堅実で洗練されているように見えます。いろんな意味で、それは私が **Hug** にそうなってほしかったものです。誰かがそれを作るのを見るのは本当に刺激的です。_"
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong>[Hug](https://github.com/hugapi/hug) creator</strong> <a href="https://news.ycombinator.com/item?id=19455465"><small>(ref)</small></a></div>
---
"_REST API を構築するための **モダンなフレームワーク** を学びたい方は、**FastAPI** [...] をチェックしてみてください。 [...] 高速で、使用・習得が簡単です [...]_"
"_私たちの **API****FastAPI** に切り替えました [...] きっと気に入ると思います [...]_"
<div style="text-align: right; margin-right: 10%;">Ines Montani - Matthew Honnibal - <strong>[Explosion AI](https://explosion.ai) founders - [spaCy](https://spacy.io) creators</strong> <a href="https://x.com/_inesmontani/status/1144173225322143744"><small>(ref)</small></a> - <a href="https://x.com/honnibal/status/1144031421859655680"><small>(ref)</small></a></div>
---
"_本番運用の Python API を構築したい方には、**FastAPI** を強くおすすめします。**美しく設計**されており、**使いやすく**、**高いスケーラビリティ**があります。私たちの API ファースト開発戦略の **主要コンポーネント** となり、Virtual TAC Engineer などの多くの自動化やサービスを推進しています。_"
<div style="text-align: right; margin-right: 10%;">Deon Pillsbury - <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/"><small>(ref)</small></a></div>
---
</div>
## FastAPI Conf { #fastapi-conf }
[**FastAPI Conf '26**](https://fastapiconf.com) は **2026 年 10 月 28 日****オランダ・アムステルダム** で開催されます。FastAPI のすべてを、ソースから直接。🎤
<a class="fastapi-feature-banner" href="https://fastapiconf.com"><img src="https://fastapi.tiangolo.com/img/fastapi-conf.jpeg" alt="FastAPI Conf '26 - 2026年10月28日 - オランダ・アムステルダム"></a>
## FastAPI ミニドキュメンタリー { #fastapi-mini-documentary }
2025 年末に公開された [FastAPI ミニドキュメンタリー](https://www.youtube.com/watch?v=mpR8ngthqiE)があります。オンラインで視聴できます:
<a href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>
<a class="fastapi-feature-banner" href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>
## **Typer**、CLI 版 FastAPI { #typer-the-fastapi-of-clis }

View File

@@ -2,7 +2,7 @@
Pythonプロジェクトの作業では、**仮想環境**(または類似の仕組み)を使用し、プロジェクトごとにインストールするパッケージを分離するべきでしょう。
/// info | 情報
/// note | 備考
もし、仮想環境の概要や作成方法、使用方法について既にご存知なら、このセクションをスキップした方がよいかもしれません。🤓
@@ -18,7 +18,8 @@ Pythonプロジェクトの作業では、**仮想環境**(または類似の
///
/// info | 情報
/// note | 備考
このページでは、**仮想環境**の使用方法と、そのはたらきについて説明します。
もし**すべてを管理するツール**Pythonのインストールも含むを導入する準備ができているなら、[uv](https://github.com/astral-sh/uv) をお試しください。
@@ -554,7 +555,7 @@ Pythonをインストールしたとき、ファイルを含んだいくつか
<div class="termy">
```console
// Don't run this now, it's just an example 🤓
// 今は実行しないでください。これは単なる例です 🤓
$ pip install "fastapi[standard]"
---> 100%
```
@@ -800,7 +801,7 @@ $ cd ~/code/prisoner-of-azkaban
$ python main.py
// Error importing sirius, it's not installed 😱
// sirius のインポートエラー。インストールされていません 😱
Traceback (most recent call last):
File "main.py", line 1, in <module>
import sirius
@@ -808,20 +809,20 @@ Traceback (most recent call last):
</div>
しかし、その仮想環境を無効化し、 `prisoner-of-askaban` のための新しい仮想環境を有効にすれば、 `python` を実行したときに `prisoner-of-azkaban` (アズカバンの囚人)の仮想環境の Python が使用されるようになります。
しかし、その仮想環境を無効化し、 `prisoner-of-azkaban` のための新しい仮想環境を有効にすれば、 `python` を実行したときに `prisoner-of-azkaban` (アズカバンの囚人)の仮想環境の Python が使用されるようになります。
<div class="termy">
```console
$ cd ~/code/prisoner-of-azkaban
// You don't need to be in the old directory to deactivate, you can do it wherever you are, even after going to the other project 😎
// 無効化のために古いディレクトリにいる必要はありません。どこにいても、他のプロジェクトに移動した後でも実行できます 😎
$ deactivate
// Activate the virtual environment in prisoner-of-azkaban/.venv 🚀
// prisoner-of-azkaban/.venv の仮想環境を有効化する 🚀
$ source .venv/bin/activate
// Now when you run python, it will find the package sirius installed in this virtual environment
// これで python を実行すると、この仮想環境にインストールされた sirius パッケージが見つかります
$ python main.py
I solemnly swear 🐺

View File

@@ -1 +0,0 @@
INHERIT: ../en/mkdocs.yml

View File

@@ -30,7 +30,6 @@ FastAPI는 **OpenAPI 3.1** 사양을 자동으로 생성하므로, 사용하는
예를 들어 다음을 사용해 볼 수 있습니다:
* [Speakeasy](https://speakeasy.com/editor?utm_source=fastapi+repo&utm_medium=github+sponsorship)
* [Stainless](https://www.stainless.com/?utm_source=fastapi&utm_medium=referral)
* [liblab](https://developers.liblab.com/tutorials/sdk-for-fastapi?utm_source=fastapi)

View File

@@ -1,3 +1,8 @@
---
include_yaml:
sponsors: data/sponsors.yml
---
# FastAPI { #fastapi }
<style>
@@ -54,18 +59,27 @@ FastAPI는 현대적이고, 빠르며(고성능), 파이썬 표준 타입 힌트
### 키스톤 스폰서 { #keystone-sponsor }
<div class="fastapi-sponsors fastapi-sponsors--keystone">
{% for sponsor in sponsors.keystone -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--keystone" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}"></a>
{% endfor -%}
</div>
### 골드 및 실버 스폰서 { #gold-and-silver-sponsors }
### 골드 스폰서 { #gold-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--gold">
{% for sponsor in sponsors.gold -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
<a class="fastapi-sponsors__card fastapi-sponsors__card--gold" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor -%}
{%- for sponsor in sponsors.silver -%}
<a href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
</div>
### 실버 스폰서 { #silver-sponsors }
<div class="fastapi-sponsors fastapi-sponsors--silver">
{% for sponsor in sponsors.silver -%}
<a class="fastapi-sponsors__card fastapi-sponsors__card--silver" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>
{% endfor %}
</div>
<!-- /sponsors -->
@@ -73,55 +87,81 @@ FastAPI는 현대적이고, 빠르며(고성능), 파이썬 표준 타입 힌트
## 의견들 { #opinions }
<!-- only-mkdocs -->
<div class="fastapi-opinions" data-fastapi-opinions>
<div class="fastapi-opinions__tabs" role="tablist" aria-label="Companies using FastAPI">
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-microsoft" aria-controls="fo-panel-microsoft" aria-selected="true" tabindex="0">
<span class="fastapi-opinions__mark"><img src="/img/logos/microsoft.svg" alt="Microsoft" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-uber" aria-controls="fo-panel-uber" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/uber.svg" alt="Uber" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-netflix" aria-controls="fo-panel-netflix" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/netflix.svg" alt="Netflix" loading="lazy"></span>
</button>
<button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-cisco" aria-controls="fo-panel-cisco" aria-selected="false" tabindex="-1">
<span class="fastapi-opinions__mark"><img src="/img/logos/cisco.svg" alt="Cisco" loading="lazy"></span>
</button>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-microsoft" role="tabpanel" aria-labelledby="fo-tab-microsoft" tabindex="0">
<blockquote class="fastapi-opinions__quote">"저는 요즘 <strong>FastAPI</strong>를 많이 사용하고 있습니다. 우리 팀의 모든 <strong>마이크로소프트 ML 서비스</strong>에 사용할 계획입니다. 그중 일부는 핵심 <strong>Windows</strong> 제품과 일부 <strong>Office</strong> 제품에 통합되고 있습니다."</blockquote>
<div class="fastapi-opinions__attr">— Kabir Khan, <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-uber" role="tabpanel" aria-labelledby="fo-tab-uber" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">"우리는 <strong>FastAPI</strong> 라이브러리를 채택해 <strong>예측</strong>을 얻기 위해 쿼리할 수 있는 <strong>REST</strong> 서버를 생성했습니다." <em>[Ludwig을 위해]</em></blockquote>
<div class="fastapi-opinions__attr">— Piero Molino, Yaroslav Dudin, Sai Sumanth Miryala, <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-netflix" role="tabpanel" aria-labelledby="fo-tab-netflix" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">"<strong>Netflix</strong>는 우리의 <strong>위기 관리</strong> 오케스트레이션 프레임워크인 <strong>Dispatch</strong>의 오픈 소스 공개를 발표하게 되어 기쁩니다!" <em>[FastAPI로 빌드]</em></blockquote>
<div class="fastapi-opinions__attr">— Kevin Glisson, Marc Vilanova, Forest Monsen, <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072">(ref)</a></div>
</div>
<div class="fastapi-opinions__panel" id="fo-panel-cisco" role="tabpanel" aria-labelledby="fo-tab-cisco" tabindex="0" hidden>
<blockquote class="fastapi-opinions__quote">"프로덕션 Python API를 만들고자 한다면, 저는 <strong>FastAPI</strong>를 강력히 추천합니다. <strong>아름답게 설계</strong>되었고, <strong>사용이 간단</strong>하며, <strong>확장성이 매우 뛰어납니다</strong> — 우리의 API 우선 개발 전략에서 <strong>핵심 구성 요소</strong>가 되었습니다."</blockquote>
<div class="fastapi-opinions__attr">— Deon Pillsbury, <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/">(ref)</a></div>
</div>
</div>
<!-- /only-mkdocs -->
<div class="only-github" markdown="1">
"_[...] 저는 요즘 **FastAPI**를 많이 사용하고 있습니다. [...] 사실 우리 팀의 **마이크로소프트 ML 서비스** 전부를 바꿀 계획입니다. 그중 일부는 핵심 **Windows**와 몇몇의 **Office** 제품들이 통합되고 있습니다._"
<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>마이크로소프트</strong> <a href="https://github.com/fastapi/fastapi/pull/26"><small>(ref)</small></a></div>
<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26"><small>(ref)</small></a></div>
---
"_**FastAPI** 라이브러리를 채택하여 **예측**을 얻기 위해 쿼리를 실행 할 수 있는 **REST** 서버를 생성했습니다. [Ludwig을 위해]_"
"_**FastAPI** 라이브러리를 채택하여 **예측**을 얻기 위해 쿼리를 실행할 수 있는 **REST** 서버를 생성했습니다. [Ludwig을 위해]_"
<div style="text-align: right; margin-right: 10%;">Piero Molino, Yaroslav Dudin 그리고 Sai Sumanth Miryala - <strong>우버</strong> <a href="https://eng.uber.com/ludwig-v0-2/"><small>(ref)</small></a></div>
<div style="text-align: right; margin-right: 10%;">Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/"><small>(ref)</small></a></div>
---
"_**Netflix**는 우리의 오픈 소스 배포판인 **위기 관리** 오케스트레이션 프레임워크를 발표할 수 있어 기쁩니다: 바로 **Dispatch**입니다! [**FastAPI**로 빌드]_"
<div style="text-align: right; margin-right: 10%;">Kevin Glisson, Marc Vilanova, Forest Monsen - <strong>넷플릭스</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072"><small>(ref)</small></a></div>
<div style="text-align: right; margin-right: 10%;">Kevin Glisson, Marc Vilanova, Forest Monsen - <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072"><small>(ref)</small></a></div>
---
"_**FastAPI**가 너무 좋아서 구름 위를 걷는듯 합니다. 정말 즐겁습니다!_"
<div style="text-align: right; margin-right: 10%;">Brian Okken - <strong>[Python Bytes](https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855) podcast host</strong> <a href="https://x.com/brianokken/status/1112220079972728832"><small>(ref)</small></a></div>
---
"_솔직히, 당신이 만든 것은 매우 견고하고 세련되어 보입니다. 여러 면에서 **Hug**가 이렇게 되었으면 합니다 - 그걸 만든 누군가를 보는 것은 많은 영감을 줍니다._"
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong>[Hug](https://github.com/hugapi/hug) 제작자</strong> <a href="https://news.ycombinator.com/item?id=19455465"><small>(ref)</small></a></div>
---
"_REST API를 만들기 위해 **현대적인 프레임워크**를 찾고 있다면 **FastAPI**를 확인해 보십시오. [...] 빠르고, 쓰기 쉽고, 배우기도 쉽습니다 [...]_"
"_우리 **API**를 **FastAPI**로 바꿨습니다 [...] 아마 여러분도 좋아하실 것입니다 [...]_"
<div style="text-align: right; margin-right: 10%;">Ines Montani - Matthew Honnibal - <strong>[Explosion AI](https://explosion.ai) 설립자 - [spaCy](https://spacy.io) 제작자</strong> <a href="https://x.com/_inesmontani/status/1144173225322143744"><small>(ref)</small></a> - <a href="https://x.com/honnibal/status/1144031421859655680"><small>(ref)</small></a></div>
---
"_프로덕션 Python API를 만들고자 한다면, 저는 **FastAPI**를 강력히 추천합니다. **아름답게 설계**되었고, **사용이 간단**하며, **확장성이 매우 뛰어나**고, 우리의 API 우선 개발 전략에서 **핵심 구성 요소**가 되었으며 Virtual TAC Engineer 같은 많은 자동화와 서비스를 이끌고 있습니다._"
"_프로덕션 Python API를 만들고자 한다면, 저는 **FastAPI**를 강력히 추천합니다. **아름답게 설계**되었고, **사용이 간단**하며, **확장성이 매우 뛰어나** 우리의 API 우선 개발 전략에서 **핵심 구성 요소**가 되었습니다._"
<div style="text-align: right; margin-right: 10%;">Deon Pillsbury - <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/"><small>(ref)</small></a></div>
---
</div>
## FastAPI Conf { #fastapi-conf }
[**FastAPI Conf '26**](https://fastapiconf.com)은 **2026년 10월 28일**, **네덜란드 암스테르담**에서 열립니다. FastAPI에 관한 모든 것, 바로 출처에서. 🎤
<a class="fastapi-feature-banner" href="https://fastapiconf.com"><img src="https://fastapi.tiangolo.com/img/fastapi-conf.jpeg" alt="FastAPI Conf '26 - October 28, 2026 - Amsterdam, NL"></a>
## FastAPI 미니 다큐멘터리 { #fastapi-mini-documentary }
2025년 말에 공개된 [FastAPI 미니 다큐멘터리](https://www.youtube.com/watch?v=mpR8ngthqiE)가 있습니다. 온라인에서 시청할 수 있습니다:
<a href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>
<a class="fastapi-feature-banner" href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>
## **Typer**, CLI를 위한 FastAPI { #typer-the-fastapi-of-clis }

View File

@@ -2,13 +2,13 @@
Python 프로젝트를 작업할 때는 **가상 환경**(또는 이와 유사한 메커니즘)을 사용해 각 프로젝트마다 설치하는 패키지를 분리하는 것이 좋습니다.
/// info
/// note | 참고
이미 가상 환경에 대해 알고 있고, 어떻게 생성하고 사용하는지도 알고 있다면, 이 섹션은 건너뛰어도 괜찮습니다. 🤓
///
/// tip
/// tip | 팁
**가상 환경**은 **환경 변수**와 다릅니다.
@@ -18,7 +18,7 @@ Python 프로젝트를 작업할 때는 **가상 환경**(또는 이와 유사
///
/// info
/// note | 참고
이 페이지에서는 **가상 환경**을 사용하는 방법과 작동 방식을 알려드립니다.
@@ -55,7 +55,7 @@ $ cd awesome-project
Python 프로젝트를 **처음 시작할 때**, 가상 환경을 **<dfn title="다른 옵션도 있지만, 이것은 간단한 가이드라인입니다">프로젝트 내부</dfn>**에 생성하세요.
/// tip
/// tip | 팁
이 작업은 **프로젝트당 한 번만** 하면 되며, 작업할 때마다 할 필요는 없습니다.
@@ -96,7 +96,7 @@ $ uv venv
</div>
/// tip
/// tip | 팁
기본적으로 `uv``.venv`라는 디렉터리에 가상 환경을 생성합니다.
@@ -118,7 +118,7 @@ $ uv venv
이후 실행하는 Python 명령어와 설치하는 패키지가 새 가상 환경을 사용하도록, 새 가상 환경을 활성화하세요.
/// tip
/// tip | 팁
프로젝트 작업을 위해 **새 터미널 세션**을 시작할 때마다 **매번** 이 작업을 하세요.
@@ -162,7 +162,7 @@ $ source .venv/Scripts/activate
////
/// tip
/// tip | 팁
해당 환경에 **새 패키지**를 설치할 때마다, 환경을 다시 **활성화**하세요.
@@ -174,7 +174,7 @@ $ source .venv/Scripts/activate
가상 환경이 활성화되어 있는지(이전 명령어가 작동했는지) 확인합니다.
/// tip
/// tip | 팁
이 단계는 **선택 사항**이지만, 모든 것이 예상대로 작동하고 있는지, 그리고 의도한 가상 환경을 사용하고 있는지 **확인**하는 좋은 방법입니다.
@@ -214,7 +214,7 @@ C:\Users\user\code\awesome-project\.venv\Scripts\python
## `pip` 업그레이드 { #upgrade-pip }
/// tip
/// tip | 팁
[`uv`](https://github.com/astral-sh/uv)를 사용한다면, `pip` 대신 `uv`로 설치하게 되므로 `pip`을 업그레이드할 필요가 없습니다. 😎
@@ -224,7 +224,7 @@ C:\Users\user\code\awesome-project\.venv\Scripts\python
패키지 설치 중 발생하는 다양한 특이한 오류는 먼저 `pip`를 업그레이드하는 것만으로 해결되는 경우가 많습니다.
/// tip
/// tip | 팁
보통 이 작업은 가상 환경을 만든 직후 **한 번만** 하면 됩니다.
@@ -242,7 +242,7 @@ $ python -m pip install --upgrade pip
</div>
/// tip
/// tip | 팁
때로는 pip를 업그레이드하려고 할 때 **`No module named pip`** 오류가 발생할 수 있습니다.
@@ -266,13 +266,13 @@ $ python -m ensurepip --upgrade
**Git**을 사용하고 있다면(사용하는 것이 좋습니다), `.venv`의 모든 내용을 Git에서 제외하도록 `.gitignore` 파일을 추가하세요.
/// tip
/// tip | 팁
[`uv`](https://github.com/astral-sh/uv)로 가상 환경을 만들었다면, 이미 자동으로 처리되어 있으므로 이 단계는 건너뛰어도 됩니다. 😎
///
/// tip
/// tip | 팁
가상 환경을 만든 직후 **한 번만** 하면 됩니다.
@@ -306,7 +306,7 @@ $ echo "*" > .venv/.gitignore
환경을 활성화한 뒤, 그 안에 패키지를 설치할 수 있습니다.
/// tip
/// tip | 팁
프로젝트에 필요한 패키지를 설치하거나 업그레이드할 때는 **한 번**만 하면 됩니다.
@@ -318,7 +318,7 @@ $ echo "*" > .venv/.gitignore
급하게 작업 중이고 프로젝트의 패키지 요구사항을 선언하는 파일을 사용하고 싶지 않다면, 패키지를 직접 설치할 수 있습니다.
/// tip
/// tip | 팁
프로그램에 필요한 패키지와 버전을 파일(예: `requirements.txt` 또는 `pyproject.toml`)에 적어두는 것은 (매우) 좋은 생각입니다.
@@ -419,7 +419,7 @@ Hello World
* [VS Code](https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment)
* [PyCharm](https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html)
/// tip
/// tip | 팁
보통 이 설정은 가상 환경을 만들 때 **한 번만** 하면 됩니다.
@@ -445,7 +445,7 @@ $ deactivate
/// tip
/// tip | 팁
위의 내용이 무엇인지 더 이해하고 싶으신가요?
@@ -536,7 +536,7 @@ flowchart LR
end
```
/// tip
/// tip | 팁
Python 패키지에서는 **새 버전**에서 **호환성을 깨뜨리는 변경(breaking changes)**을 **피하려고** 최선을 다하는 것이 매우 일반적이지만, 안전을 위해 더 최신 버전은 의도적으로 설치하고, 테스트를 실행해 모든 것이 올바르게 작동하는지 확인할 수 있을 때 설치하는 것이 좋습니다.
@@ -643,7 +643,7 @@ $ source .venv/Scripts/activate
그 변수 중 하나가 `PATH` 변수입니다.
/// tip
/// tip | 팁
`PATH` 환경 변수에 대해 더 알아보려면 [환경 변수](environment-variables.md#path-environment-variable) 섹션을 참고하세요.
@@ -776,7 +776,7 @@ Linux와 macOS에서는 `which`, Windows PowerShell에서는 `Get-Command`를
따라서 올바른 가상 환경에 있는지 확인할 수 있습니다.
/// tip
/// tip | 팁
가상 환경을 하나 활성화해서 Python을 사용한 다음, **다른 프로젝트로 이동**하기 쉽습니다.
@@ -819,7 +819,7 @@ Traceback (most recent call last):
</div>
하지만 가상 환경을 비활성화하고 `prisoner-of-askaban`에 대한 새 가상 환경을 활성화하면, `python`을 실행할 때 `prisoner-of-azkaban`의 가상 환경에 있는 Python을 사용하게 됩니다.
하지만 가상 환경을 비활성화하고 `prisoner-of-azkaban`에 대한 새 가상 환경을 활성화하면, `python`을 실행할 때 `prisoner-of-azkaban`의 가상 환경에 있는 Python을 사용하게 됩니다.
<div class="termy">

Some files were not shown because too many files have changed in this diff Show More