- Sort Score
- Num 10 results
- Language All
Results 1051 - 1060 of 2,110 for py$ (0.01 seconds)
-
docs/ja/docs/tutorial/cookie-params.md
## `Cookie`をインポート { #import-cookie } まず、`Cookie`をインポートします: {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[3] *} ## `Cookie`のパラメータを宣言 { #declare-cookie-parameters } 次に、`Path`や`Query`と同じ構造を使ってクッキーのパラメータを宣言します。 最初の値がデフォルト値で、追加の検証パラメータや注釈パラメータをすべて渡すことができます: {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[9] *} /// note | 技術詳細 `Cookie`は`Path`と`Query`の「姉妹」クラスです。また、同じ共通の`Param`クラスを継承しています。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 04 16:44:21 GMT 2026 - 2K bytes - Click Count (0) -
docs/en/docs/tutorial/security/first-steps.md
## How it looks { #how-it-looks } Let's first just use the code and see how it works, and then we'll come back to understand what's happening. ## Create `main.py` { #create-main-py } Copy the example in a file `main.py`: {* ../../docs_src/security/tutorial001_an_py310.py *} ## Run it { #run-it } /// infoCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 07 09:29:03 GMT 2026 - 8.3K bytes - Click Count (0) -
docs/zh/docs/tutorial/security/simple-oauth2.md
接下来,使用 **FastAPI** 工具获取用户名与密码。 ### `OAuth2PasswordRequestForm` { #oauth2passwordrequestform } 首先,导入 `OAuth2PasswordRequestForm`,然后,在 `/token` *路径操作* 中,用 `Depends` 把该类作为依赖项。 {* ../../docs_src/security/tutorial003_an_py310.py hl[4,78] *} `OAuth2PasswordRequestForm` 是用以下几项内容声明表单请求体的类依赖项: * `username` * `password` * 可选的 `scope` 字段,由多个空格分隔的字符串组成的长字符串 * 可选的 `grant_type` /// tip | 提示Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 9K bytes - Click Count (0) -
docs/en/docs/tutorial/query-param-models.md
Declare the **query parameters** that you need in a **Pydantic model**, and then declare the parameter as `Query`: {* ../../docs_src/query_param_models/tutorial001_an_py310.py hl[9:13,17] *} **FastAPI** will **extract** the data for **each field** from the **query parameters** in the request and give you the Pydantic model you defined. ## Check the Docs { #check-the-docs }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Aug 31 09:15:41 GMT 2025 - 2.2K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/sub-applications.md
### 頂層應用程式 { #top-level-application } 先建立主(頂層)**FastAPI** 應用程式以及它的*路徑操作*: {* ../../docs_src/sub_applications/tutorial001_py310.py hl[3, 6:8] *} ### 子應用程式 { #sub-application } 接著,建立你的子應用程式及其*路徑操作*。 這個子應用程式就是另一個標準的 FastAPI 應用,但這個會被「掛載」: {* ../../docs_src/sub_applications/tutorial001_py310.py hl[11, 14:16] *} ### 掛載子應用程式 { #mount-the-sub-application } 在你的頂層應用程式 `app` 中,掛載子應用程式 `subapi`。 在此範例中,它會被掛載在路徑 `/subapi`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 2.8K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/body-fields.md
## 匯入 `Field` { #import-field } 首先,你需要匯入它: {* ../../docs_src/body_fields/tutorial001_an_py310.py hl[4] *} /// warning 請注意,`Field` 是直接從 `pydantic` 匯入的,不像其他(如 `Query`、`Path`、`Body` 等)是從 `fastapi` 匯入。 /// ## 宣告模型屬性 { #declare-model-attributes } 接著你可以在模型屬性上使用 `Field`: {* ../../docs_src/body_fields/tutorial001_an_py310.py hl[11:14] *} `Field` 的用法與 `Query`、`Path`、`Body` 相同,擁有相同的參數等。 /// note | 技術細節Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:15:26 GMT 2026 - 2.3K bytes - Click Count (0) -
docs/en/docs/advanced/response-directly.md
{* ../../docs_src/response_directly/tutorial002_py310.py hl[1,18] *} ## How a Response Model Works { #how-a-response-model-works } When you declare a [Response Model - Return Type](../tutorial/response-model.md) in a path operation, **FastAPI** will use it to serialize the data to JSON, using Pydantic. {* ../../docs_src/response_model/tutorial001_01_py310.py hl[16,21] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/security/first-steps.md
我們可以用 OAuth2 搭配 FastAPI 來實作。 但不必通讀整份冗長規格只為了找出你需要的幾個重點。 就用 FastAPI 提供的工具處理安全性。 ## 看起來如何 { #how-it-looks } 先直接跑範例看效果,再回頭理解其原理。 ## 建立 `main.py` { #create-main-py } 將範例複製到檔案 `main.py`: {* ../../docs_src/security/tutorial001_an_py310.py *} ## 執行 { #run-it } /// info 當你使用 `pip install "fastapi[standard]"` 指令安裝時,[`python-multipart`](https://github.com/Kludex/python-multipart) 套件會隨 FastAPI 自動安裝。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 7.2K bytes - Click Count (0) -
docs/zh/docs/tutorial/security/first-steps.md
但为了节省你的时间,不必为获取少量信息而通读冗长的规范。 我们直接使用 **FastAPI** 提供的安全工具。 ## 效果预览 { #how-it-looks } 先直接运行代码看看效果,之后再回过头理解其背后的原理。 ## 创建 `main.py` { #create-main-py } 把下面的示例代码复制到 `main.py`: {* ../../docs_src/security/tutorial001_an_py310.py *} ## 运行 { #run-it } /// info | 信息Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 7.5K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/response-status-code.md
/// ## 快速記住名稱 { #shortcut-to-remember-the-names } 再看一次前面的範例: {* ../../docs_src/response_status_code/tutorial001_py310.py hl[6] *} `201` 是「已建立(Created)」的狀態碼。 但你不需要背下每個代碼代表什麼。 你可以使用 `fastapi.status` 提供的便利變數。 {* ../../docs_src/response_status_code/tutorial002_py310.py hl[1,6] *} 它們只是方便用的常數,值與數字相同,但這樣你可以用編輯器的自動完成來找到它們: <img src="/img/tutorial/response-status-code/image02.png"> /// note | 技術細節Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 3.7K bytes - Click Count (0)