Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 161 for tutorial003 (0.13 sec)

  1. docs/ko/docs/tutorial/response-model.md

    대신 평문 비밀번호로 입력 모델을 만들고 해당 비밀번호 없이 출력 모델을 만들 수 있습니다:
    
    {* ../../docs_src/response_model/tutorial003.py hl[9,11,16] *}
    
    여기서 *경로 작동 함수*가 비밀번호를 포함하는 동일한 입력 사용자를 반환할지라도:
    
    {* ../../docs_src/response_model/tutorial003.py hl[24] *}
    
    ...`response_model`을 `UserOut` 모델로 선언했기 때문에 비밀번호를 포함하지 않습니다:
    
    {* ../../docs_src/response_model/tutorial003.py hl[22] *}
    
    따라서 **FastAPI**는 출력 모델에서 선언하지 않은 모든 데이터를 (Pydantic을 사용하여) 필터링합니다.
    
    ## 문서에서 보기
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/security/simple-oauth2.md

    ## 获取 `username` 和 `password` 的代码
    
    接下来,使用 **FastAPI** 工具获取用户名与密码。
    
    ### `OAuth2PasswordRequestForm`
    
    首先,导入 `OAuth2PasswordRequestForm`,然后,在 `/token` *路径操作* 中,用 `Depends` 把该类作为依赖项。
    
    {* ../../docs_src/security/tutorial003.py hl[4,76] *}
    
    `OAuth2PasswordRequestForm` 是用以下几项内容声明表单请求体的类依赖项:
    
    * `username`
    * `password`
    * 可选的 `scope` 字段,由多个空格分隔的字符串组成的长字符串
    * 可选的 `grant_type`
    
    /// tip | 提示
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py

        tags_schema = {"default": [], "title": "Tags"}
        if mod_name.startswith("tutorial001"):
            tags_schema.update(UNTYPED_LIST_SCHEMA)
        elif mod_name.startswith("tutorial002"):
            tags_schema.update(LIST_OF_STR_SCHEMA)
        elif mod_name.startswith("tutorial003"):
            tags_schema.update(SET_OF_STR_SCHEMA)
    
        response = client.get("/openapi.json")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/testing-events.md

    # 测试事件:启动 - 关闭
    
    使用 `TestClient` 和 `with` 语句,在测试中运行事件处理器(`startup` 与 `shutdown`)。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 205 bytes
    - Viewed (0)
  5. docs/ja/docs/advanced/path-operation-advanced-configuration.md

    {* ../../docs_src/path_operation_advanced_configuration/tutorial003.py hl[6] *}
    
    ## docstringによる説明の高度な設定
    
    *path operation関数* のdocstringからOpenAPIに使用する行を制限することができます。
    
    `\f` (「書式送り (Form Feed)」のエスケープ文字) を付与することで、**FastAPI** はOpenAPIに使用される出力をその箇所までに制限します。
    
    ドキュメントには表示されませんが、他のツール (例えばSphinx) では残りの部分を利用できるでしょう。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  6. docs/ko/docs/advanced/testing-events.md

    # 이벤트 테스트: 시작 - 종료
    
    테스트에서 이벤트 핸들러(`startup` 및 `shutdown`)를 실행해야 하는 경우, `with` 문과 함께 `TestClient`를 사용할 수 있습니다.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 262 bytes
    - Viewed (0)
  7. docs/zh/docs/advanced/custom-response.md

    ///
    
    {* ../../docs_src/custom_response/tutorial001.py hl[2,7] *}
    
    /// tip | 小贴士
    
    `ORJSONResponse` 可能是一个更快的选择。
    
    ///
    
    ### `RedirectResponse`
    
    返回 HTTP 重定向。默认情况下使用 307 状态代码(临时重定向)。
    
    {* ../../docs_src/custom_response/tutorial006.py hl[2,9] *}
    
    ### `StreamingResponse`
    
    采用异步生成器或普通生成器/迭代器,然后流式传输响应主体。
    
    {* ../../docs_src/custom_response/tutorial007.py hl[2,14] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  8. docs/zh/docs/advanced/path-operation-advanced-configuration.md

    {* ../../docs_src/path_operation_advanced_configuration/tutorial003.py hl[6] *}
    
    ## docstring 的高级描述
    
    你可以限制 *路径操作函数* 的 `docstring` 中用于 OpenAPI 的行数。
    
    添加一个 `\f` (一个「换页」的转义字符)可以使 **FastAPI** 在那一位置截断用于 OpenAPI 的输出。
    
    剩余部分不会出现在文档中,但是其他工具(比如 Sphinx)可以使用剩余部分。
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/path-operation-configuration.md

    {* ../../docs_src/path_operation_configuration/tutorial002.py hl[17,22,27] *}
    
    OpenAPI 概图会自动添加标签,供 API 文档接口使用:
    
    <img src="/img/tutorial/path-operation-configuration/image01.png">
    
    ## `summary` 和 `description` 参数
    
    路径装饰器还支持 `summary` 和 `description` 这两个参数:
    
    {* ../../docs_src/path_operation_configuration/tutorial003.py hl[20:21] *}
    
    ## 文档字符串(`docstring`)
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  10. docs/zh/docs/advanced/events.md

    首先要注意的是,我们定义了一个带有 `yield` 的异步函数。这与带有 `yield` 的依赖项非常相似。
    
    ```Python hl_lines="14-19"
    {!../../docs_src/events/tutorial003.py!}
    ```
    
    这个函数在 `yield`之前的部分,会在应用启动前执行。
    
    剩下的部分在 `yield` 之后,会在应用完成后执行。
    
    ## 异步上下文管理器
    
    如你所见,这个函数有一个装饰器 `@asynccontextmanager` 。
    
    它将函数转化为所谓的“**异步上下文管理器**”。
    
    ```Python hl_lines="1  13"
    {!../../docs_src/events/tutorial003.py!}
    ```
    
    在 Python 中,  **上下文管理器**是一个你可以在 `with` 语句中使用的东西,例如,`open()` 可以作为上下文管理器使用。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 7K bytes
    - Viewed (0)
Back to top