- Sort Score
- Num 10 results
- Language All
Results 91 - 100 of 502 for tutorial001_an_py310 (0.09 seconds)
-
docs/zh-hant/docs/tutorial/cookie-param-models.md
同樣的技巧也適用於 `Query`、`Cookie` 與 `Header`。😎 /// ## 以 Pydantic 模型宣告 Cookie { #cookies-with-a-pydantic-model } 在 **Pydantic 模型**中宣告所需的 **Cookie** 參數,接著將參數宣告為 `Cookie`: {* ../../docs_src/cookie_param_models/tutorial001_an_py310.py hl[9:12,16] *} **FastAPI** 會從請求收到的 **Cookie** 中擷取 **每個欄位** 的資料,並交給你定義的 Pydantic 模型。 ## 查看文件 { #check-the-docs } 你可以在 `/docs` 的文件介面中看到已定義的 Cookie: <div class="screenshot">Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:15:26 GMT 2026 - 2.9K bytes - Click Count (0) -
docs/ko/docs/tutorial/cookie-param-models.md
/// ## Pydantic 모델을 사용한 쿠키 { #cookies-with-a-pydantic-model } **Pydantic 모델**에 필요한 **쿠키** 매개변수를 선언한 다음, 해당 매개변수를 `Cookie`로 선언합니다: {* ../../docs_src/cookie_param_models/tutorial001_an_py310.py hl[9:12,16] *} **FastAPI**는 요청에서 받은 **쿠키**에서 **각 필드**에 대한 데이터를 **추출**하고 정의한 Pydantic 모델을 줍니다. ## 문서 확인하기 { #check-the-docs } 문서 UI `/docs`에서 정의한 쿠키를 볼 수 있습니다: <div class="screenshot">Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:57:01 GMT 2026 - 3.6K bytes - Click Count (0) -
docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md
This means that you can install the latest version of Pydantic v2 and import and use the old Pydantic v1 components from this submodule, as if you had the old Pydantic v1 installed. {* ../../docs_src/pydantic_v1_in_v2/tutorial001_an_py310.py hl[1,4] *} ### FastAPI support for Pydantic v1 in v2 { #fastapi-support-for-pydantic-v1-in-v2 }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 5.4K bytes - Click Count (0) -
docs/zh/docs/advanced/testing-dependencies.md
对于这些用例,**FastAPI** 应用支持 `app.dependency_overrides` 属性,该属性就是**字典**。 要在测试时覆盖原有依赖项,这个字典的键应当是原依赖项(函数),值是覆盖依赖项(另一个函数)。 这样一来,**FastAPI** 就会调用覆盖依赖项,不再调用原依赖项。 {* ../../docs_src/dependency_testing/tutorial001_an_py310.py hl[26:27,30] *} /// tip | 提示 **FastAPI** 应用中的任何位置都可以实现覆盖依赖项。 原依赖项可用于*路径操作函数*、*路径操作装饰器*(不需要返回值时)、`.include_router()` 调用等。 FastAPI 可以覆盖这些位置的依赖项。 ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 13:37:57 GMT 2026 - 2K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/testing-dependencies.md
對這些情況,你的 FastAPI 應用程式有一個屬性 `app.dependency_overrides`,它是一個簡單的 `dict`。 要在測試時覆寫某個相依,把原始相依(函式)作為鍵,並把你的覆寫相依(另一個函式)作為值。 接著 FastAPI 會呼叫這個覆寫,而不是原本的相依。 {* ../../docs_src/dependency_testing/tutorial001_an_py310.py hl[26:27,30] *} /// tip 你可以為應用程式中任何地方使用到的相依設定覆寫。 原始相依可以用在*路徑操作函式*、*路徑操作裝飾器*(當你不使用其回傳值時)、`.include_router()` 呼叫等。 FastAPI 仍然能夠將其覆寫。 ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:15:26 GMT 2026 - 2.1K bytes - Click Count (0) -
docs/ko/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md
{* ../../docs_src/pydantic_v1_in_v2/tutorial001_an_py310.py hl[1,4] *} ### v2 안의 Pydantic v1에 대한 FastAPI 지원 { #fastapi-support-for-pydantic-v1-in-v2 } FastAPI 0.119.0부터는 v2로의 마이그레이션을 쉽게 하기 위해, Pydantic v2 내부의 Pydantic v1에 대해서도 부분적인 지원이 있습니다. 따라서 Pydantic을 최신 v2로 업그레이드하고, import를 `pydantic.v1` 서브모듈을 사용하도록 바꾸면, 많은 경우 그대로 동작합니다. {* ../../docs_src/pydantic_v1_in_v2/tutorial002_an_py310.py hl[2,5,15] *} /// warning | 경고Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 6.3K bytes - Click Count (0) -
docs/en/docs/tutorial/body-multiple-params.md
And you can also declare body parameters as optional, by setting the default to `None`: {* ../../docs_src/body_multiple_params/tutorial001_an_py310.py hl[18:20] *} /// note Notice that, in this case, the `item` that would be taken from the body is optional. As it has a `None` default value. ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 11 18:32:12 GMT 2026 - 4.8K bytes - Click Count (0) -
docs/zh/docs/tutorial/security/get-current-user.md
{* ../../docs_src/security/tutorial002_an_py310.py hl[25] *} ## 获取用户 { #get-the-user } `get_current_user` 使用创建的(伪)工具函数,该函数接收 `str` 类型的令牌,并返回 Pydantic 的 `User` 模型: {* ../../docs_src/security/tutorial002_an_py310.py hl[19:22,26:27] *} ## 注入当前用户 { #inject-the-current-user } 在*路径操作* 的 `Depends` 中使用 `get_current_user`: {* ../../docs_src/security/tutorial002_an_py310.py hl[31] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 13:37:57 GMT 2026 - 3.6K bytes - Click Count (0) -
docs/zh/docs/tutorial/cookie-param-models.md
此技术同样适用于 `Query` 、 `Cookie` 和 `Header` 。😎 /// ## 带有 Pydantic 模型的 Cookie { #cookies-with-a-pydantic-model } 在 **Pydantic** 模型中声明所需的 **cookie** 参数,然后将参数声明为 `Cookie` : {* ../../docs_src/cookie_param_models/tutorial001_an_py310.py hl[9:12,16] *} **FastAPI** 将从请求中接收到的 **cookie** 中**提取**出**每个字段**的数据,并提供您定义的 Pydantic 模型。 ## 查看文档 { #check-the-docs } 您可以在文档 UI 的 `/docs` 中查看定义的 cookie: <div class="screenshot">Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 13:37:57 GMT 2026 - 3K bytes - Click Count (0) -
docs/ko/docs/tutorial/security/get-current-user.md
{* ../../docs_src/security/tutorial001_an_py310.py hl[12] *} 하지만 이는 여전히 그다지 유용하지 않습니다. 현재 사용자를 제공하도록 해봅시다. ## 사용자 모델 생성하기 { #create-a-user-model } 먼저 Pydantic 사용자 모델을 만들어 봅시다. Pydantic을 사용해 본문을 선언하는 것과 같은 방식으로, 다른 곳에서도 어디서든 사용할 수 있습니다: {* ../../docs_src/security/tutorial002_an_py310.py hl[5,12:6] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:57:01 GMT 2026 - 4.9K bytes - Click Count (0)