@ -106,19 +106,19 @@ FastAPI 是一个用于构建 API 的现代、快速(高性能)的 Web 框
< div class = "fastapi-opinions__panel" id = "fo-panel-microsoft" role = "tabpanel" aria-labelledby = "fo-tab-microsoft" tabindex = "0" >
< 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 >
< 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 class = "fastapi-opinions__attr" > — Kabir Khan,< strong > Microsoft< / strong > < a href = "https://github.com/fastapi/fastapi/pull/26" > (参考 )< / a > < / div >
< / div >
< / div >
< div class = "fastapi-opinions__panel" id = "fo-panel-uber" role = "tabpanel" aria-labelledby = "fo-tab-uber" tabindex = "0" hidden >
< 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 >
< 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 class = "fastapi-opinions__attr" > — Piero Molino,Yaroslav Dudin,Sai Sumanth Miryala,< strong > Uber< / strong > < a href = "https://eng.uber.com/ludwig-v0-2/" > (参考 )< / a > < / div >
< / div >
< / div >
< div class = "fastapi-opinions__panel" id = "fo-panel-netflix" role = "tabpanel" aria-labelledby = "fo-tab-netflix" tabindex = "0" hidden >
< 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 >
< 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 class = "fastapi-opinions__attr" > — Kevin Glisson,Marc Vilanova,Forest Monsen,< strong > Netflix< / strong > < a href = "https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072" > (参考 )< / a > < / div >
< / div >
< / div >
< div class = "fastapi-opinions__panel" id = "fo-panel-cisco" role = "tabpanel" aria-labelledby = "fo-tab-cisco" tabindex = "0" hidden >
< 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 >
< 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 class = "fastapi-opinions__attr" > — Deon Pillsbury,< strong > Cisco< / strong > < a href = "https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/" > (参考 )< / a > < / div >
< / div >
< / div >
< / div >
< / div >
<!-- /only - mkdocs -->
<!-- /only - mkdocs -->
@ -127,25 +127,25 @@ FastAPI 是一个用于构建 API 的现代、快速(高性能)的 Web 框
「_[...] 我最近大量使用 **FastAPI** 。[...] 我实际上计划把它用于我团队在 **微软的机器学习(ML)服务** 。其中一些正在集成进核心 **Windows** 产品以及一些 **Office** 产品。_」
「_[...] 我最近大量使用 **FastAPI** 。[...] 我实际上计划把它用于我团队在 **微软的机器学习(ML)服务** 。其中一些正在集成进核心 **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 >
< div style = "text-align: right; margin-right: 10%;" > Kabir Khan - < strong > Microsoft< / strong > < a href = "https://github.com/fastapi/fastapi/pull/26" > < small > (参考 )< / 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 > 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,Sai Sumanth Miryala - < strong > Uber< / strong > < a href = "https://eng.uber.com/ludwig-v0-2/" > < small > (参考 )< / small > < / a > < / div >
---
---
「_**Netflix** 很高兴宣布开源我们的**危机管理**编排框架:**Dispatch**![使用 **FastAPI** 构建]_」
「_**Netflix** 很高兴宣布开源我们的**危机管理**编排框架:**Dispatch**![使用 **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 >
< 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 > (参考 )< / small > < / a > < / div >
---
---
「_如果有人正在构建生产级的 Python API,我强烈推荐 **FastAPI** 。它**设计优雅**、**使用简单**且**高度可扩展**,它已经成为我们 API 优先开发战略中的**关键组件**,并驱动了许多自动化和服务,比如我们的 Virtual TAC Engineer。_」
「_如果有人正在构建生产级的 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 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 > (参考 )< / small > < / a > < / div >
---
---
@ -192,7 +192,7 @@ $ pip install "fastapi[standard]"
< / div >
< / div >
**Note **: 请确保把 `"fastapi[standard]"` 用引号包起来,以保证在所有终端中都能正常工作。
**注意 **: 请确保把 `"fastapi[standard]"` 用引号包起来,以保证在所有终端中都能正常工作。
## 示例 { #example }
## 示例 { #example }
@ -237,7 +237,7 @@ async def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q}
return {"item_id": item_id, "q": q}
```
```
**Note **:
**注意 **:
如果你不确定,请查看文档中 _"In a hurry?"_ 章节的 [`async` 和 `await` ](https://fastapi.tiangolo.com/zh/async/#in-a-hurry ) 部分。
如果你不确定,请查看文档中 _"In a hurry?"_ 章节的 [`async` 和 `await` ](https://fastapi.tiangolo.com/zh/async/#in-a-hurry ) 部分。
@ -400,7 +400,7 @@ item_id: int
item: Item
item: Item
```
```
…… 通过一次声明,你将获得:
... 通过一次声明,你将获得:
* 编辑器支持,包括:
* 编辑器支持,包括:
* 自动补全。
* 自动补全。
@ -421,7 +421,7 @@ item: Item
* `datetime` 对象。
* `datetime` 对象。
* `UUID` 对象。
* `UUID` 对象。
* 数据库模型。
* 数据库模型。
* …… 以及更多。
* ... 以及更多。
* 自动生成的交互式 API 文档,包括两种可选的用户界面:
* 自动生成的交互式 API 文档,包括两种可选的用户界面:
* Swagger UI。
* Swagger UI。
* ReDoc。
* ReDoc。
@ -457,19 +457,19 @@ item: Item
return {"item_name": item.name, "item_id": item_id}
return {"item_name": item.name, "item_id": item_id}
```
```
…… 从:
... 从:
```Python
```Python
... "item_name": item.name ...
... "item_name": item.name ...
```
```
…… 改为:
... 改为:
```Python
```Python
... "item_price": item.price ...
... "item_price": item.price ...
```
```
…… 看看你的编辑器如何自动补全属性并知道它们的类型:
... 看看你的编辑器如何自动补全属性并知道它们的类型:


@ -488,7 +488,7 @@ item: Item
* 基于 HTTPX 和 `pytest` 的极其简单的测试
* 基于 HTTPX 和 `pytest` 的极其简单的测试
* * *CORS**
* * *CORS**
* * *Cookie Sessions**
* * *Cookie Sessions**
* …… 以及更多。
* ... 以及更多。
### 部署你的应用(可选) { #deploy -your-app-optional }
### 部署你的应用(可选) { #deploy -your-app-optional }