- Sort Score
- Num 10 results
- Language All
Results 81 - 90 of 1,139 for docs_src (0.06 seconds)
-
docs/ja/docs/tutorial/security/get-current-user.md
一つ前の章では、(依存性注入システムに基づいた)セキュリティシステムは、 *path operation 関数* に `str` として `token` を与えていました: {* ../../docs_src/security/tutorial001_an_py310.py hl[12] *} しかし、それはまだそんなに有用ではありません。 現在のユーザーを取得するようにしてみましょう。 ## ユーザーモデルの作成 { #create-a-user-model } まずは、Pydanticのユーザーモデルを作成しましょう。 ボディを宣言するのにPydanticを使用するのと同じやり方で、Pydanticを別のどんなところでも使うことができます: {* ../../docs_src/security/tutorial002_an_py310.py hl[5,12:6] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 15:24:30 GMT 2026 - 5.7K bytes - Click Count (0) -
docs/ko/docs/how-to/configure-swagger-ui.md
그러나 `syntaxHighlight`를 `False`로 설정하여 구문 강조 기능을 비활성화할 수 있습니다: {* ../../docs_src/configure_swagger_ui/tutorial001_py310.py hl[3] *} ...그럼 Swagger UI에서 더 이상 구문 강조 기능이 표시되지 않습니다: <img src="/img/tutorial/extending-openapi/image03.png"> ## 테마 변경 { #change-the-theme } 동일한 방식으로 `"syntaxHighlight.theme"` 키를 사용하여 구문 강조 테마를 설정할 수 있습니다 (중간에 점이 포함된 것을 참고하십시오). {* ../../docs_src/configure_swagger_ui/tutorial002_py310.py hl[3] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 3.2K bytes - Click Count (0) -
docs/en/docs/advanced/testing-events.md
{* ../../docs_src/app_testing/tutorial004_py310.py hl[9:15,18,27:28,30:32,41:43] *} You can read more details about the ["Running lifespan in tests in the official Starlette documentation site."](https://www.starlette.dev/lifespan/#running-lifespan-in-tests) For the deprecated `startup` and `shutdown` events, you can use the `TestClient` as follows:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 628 bytes - Click Count (0) -
docs/zh/docs/tutorial/body.md
/// ## 导入 Pydantic 的 `BaseModel` { #import-pydantics-basemodel } 从 `pydantic` 中导入 `BaseModel`: {* ../../docs_src/body/tutorial001_py310.py hl[2] *} ## 创建数据模型 { #create-your-data-model } 把数据模型声明为继承 `BaseModel` 的类。 使用 Python 标准类型声明所有属性: {* ../../docs_src/body/tutorial001_py310.py hl[5:9] *} 与声明查询参数一样,包含默认值的模型属性是可选的,否则就是必选的。把默认值设为 `None` 可使其变为可选。 例如,上述模型声明如下 JSON "object"(即 Python `dict`):Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 5.9K bytes - Click Count (0) -
docs/zh/docs/advanced/stream-data.md
{* ../../docs_src/stream_data/tutorial002_py310.py ln[6,19:20] hl[20] *} 然后你可以在*路径操作函数*中通过 `response_class=PNGStreamingResponse` 使用这个新类: {* ../../docs_src/stream_data/tutorial002_py310.py ln[23:27] hl[23] *} ### 模拟文件 { #simulate-a-file } 在这个示例中,我们用 `io.BytesIO` 模拟了一个文件,它是只驻留在内存中的类文件对象,但提供相同的接口。 例如,我们可以像对文件那样迭代它来消费其内容。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:29:48 GMT 2026 - 5.2K bytes - Click Count (0) -
docs/zh/docs/advanced/testing-events.md
当你需要在测试中运行 `lifespan` 时,可以将 `TestClient` 与 `with` 语句一起使用: {* ../../docs_src/app_testing/tutorial004_py310.py hl[9:15,18,27:28,30:32,41:43] *} 你可以在[官方 Starlette 文档站点的“在测试中运行 lifespan”](https://www.starlette.dev/lifespan/#running-lifespan-in-tests)阅读更多细节。 对于已弃用的 `startup` 和 `shutdown` 事件,可以按如下方式使用 `TestClient`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 13:37:57 GMT 2026 - 622 bytes - Click Count (0) -
docs/en/docs/tutorial/stream-json-lines.md
{* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[1:24] hl[24] *} If each JSON item you want to send back is of type `Item` (a Pydantic model) and it's an async function, you can declare the return type as `AsyncIterable[Item]`: {* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[1:24] hl[9:11,22] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.3K bytes - Click Count (0) -
docs/ko/docs/tutorial/security/get-current-user.md
이전 장에서 (의존성 주입 시스템을 기반으로 한) 보안 시스템은 *경로 처리 함수*에 `str`로 `token`을 제공했습니다: {* ../../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) -
docs/zh-hant/docs/how-to/extending-openapi.md
{* ../../docs_src/extending_openapi/tutorial001_py310.py hl[22:24] *} ### 快取 OpenAPI 結構 { #cache-the-openapi-schema } 你可以把 `.openapi_schema` 屬性當作「快取」來儲存已產生的結構。 這樣使用者每次開啟 API 文件時,應用就不必重複產生結構。 結構只會產生一次,之後的請求都會使用相同的快取結果。 {* ../../docs_src/extending_openapi/tutorial001_py310.py hl[13:14,25:26] *} ### 覆寫方法 { #override-the-method } 現在你可以用新的函式取代 `.openapi()` 方法。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 3K bytes - Click Count (0) -
docs/en/docs/tutorial/cookie-params.md
First import `Cookie`: {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[3] *} ## Declare `Cookie` parameters { #declare-cookie-parameters } Then declare the cookie parameters using the same structure as with `Path` and `Query`. You can define the default value as well as all the extra validation or annotation parameters: {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[9] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Sep 20 17:49:27 GMT 2025 - 1.6K bytes - Click Count (0)