Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 51 - 60 of 1,139 for docs_src (0.05 seconds)

  1. docs/en/docs/tutorial/query-params-str-validations.md

    {* ../../docs_src/query_params_str_validations/tutorial003_an_py310.py hl[10] *}
    
    ## Add regular expressions { #add-regular-expressions }
    
    You can define a <dfn title="A regular expression, regex or regexp is a sequence of characters that define a search pattern for strings.">regular expression</dfn> `pattern` that the parameter should match:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 16.3K bytes
    - Click Count (0)
  2. docs/en/docs/tutorial/header-param-models.md

    ///
    
    ## Header Parameters with a Pydantic Model { #header-parameters-with-a-pydantic-model }
    
    Declare the **header parameters** that you need in a **Pydantic model**, and then declare the parameter as `Header`:
    
    {* ../../docs_src/header_param_models/tutorial001_an_py310.py hl[9:14,18] *}
    
    **FastAPI** will **extract** the data for **each field** from the **headers** in the request and give you the Pydantic model you defined.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Aug 31 09:15:41 GMT 2025
    - 2.6K bytes
    - Click Count (0)
  3. docs/en/docs/tutorial/path-operation-configuration.md

    **FastAPI** supports that the same way as with plain strings:
    
    {* ../../docs_src/path_operation_configuration/tutorial002b_py310.py hl[1,8:10,13,18] *}
    
    ## Summary and description { #summary-and-description }
    
    You can add a `summary` and `description`:
    
    {* ../../docs_src/path_operation_configuration/tutorial003_py310.py hl[17:18] *}
    
    ## Description from docstring { #description-from-docstring }
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 4K bytes
    - Click Count (0)
  4. docs/zh/docs/tutorial/metadata.md

    但是你可以通过参数 `openapi_url` 对其进行配置。
    
    例如,将其设置为服务于 `/api/v1/openapi.json`:
    
    {* ../../docs_src/metadata/tutorial002_py310.py hl[3] *}
    
    如果你想完全禁用 OpenAPI 模式,可以将其设置为 `openapi_url=None`,这样也会禁用使用它的文档用户界面。
    
    ## 文档 URLs { #docs-urls }
    
    你可以配置两个文档用户界面,包括:
    
    - **Swagger UI**:服务于 `/docs`。
        - 可以使用参数 `docs_url` 设置它的 URL。
        - 可以通过设置 `docs_url=None` 禁用它。
    - **ReDoc**:服务于 `/redoc`。
        - 可以使用参数 `redoc_url` 设置它的 URL。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 5.6K bytes
    - Click Count (0)
  5. docs/en/docs/tutorial/body.md

    First, you need to import `BaseModel` from `pydantic`:
    
    {* ../../docs_src/body/tutorial001_py310.py hl[2] *}
    
    ## Create your data model { #create-your-data-model }
    
    Then you declare your data model as a class that inherits from `BaseModel`.
    
    Use standard Python types for all the attributes:
    
    {* ../../docs_src/body/tutorial001_py310.py hl[5:9] *}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 6.5K bytes
    - Click Count (0)
  6. docs/en/docs/tutorial/path-params-numeric-validations.md

    So, you can declare your function as:
    
    {* ../../docs_src/path_params_numeric_validations/tutorial002_py310.py hl[7] *}
    
    But keep in mind that if you use `Annotated`, you won't have this problem, it won't matter as you're not using the function parameter default values for `Query()` or `Path()`.
    
    {* ../../docs_src/path_params_numeric_validations/tutorial002_an_py310.py *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 6.1K bytes
    - Click Count (0)
  7. scripts/docs.py

        """
        Delete .py files in docs_src that are not included in any .md file under docs/.
        """
        docs_src_path = Path("docs_src")
        # Collect all docs .md content referencing docs_src
        all_docs_content = ""
        for md_file in docs_path.rglob("*.md"):
            all_docs_content += md_file.read_text(encoding="utf-8")
        # Build a set of directory-based package roots (e.g. docs_src/bigger_applications/app_py39)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 17:46:10 GMT 2026
    - 25.4K bytes
    - Click Count (0)
  8. docs/zh/docs/how-to/custom-docs-ui-assets.md

    如果你所在的国家/地区屏蔽了某些 URL,这会很有用。
    
    ### 关闭自动文档 { #disable-the-automatic-docs }
    
    第一步是关闭自动文档,因为默认它们会使用默认的 CDN。
    
    要关闭它们,在创建 `FastAPI` 应用时将其 URL 设为 `None`:
    
    {* ../../docs_src/custom_docs_ui/tutorial001_py310.py hl[8] *}
    
    ### 包含自定义文档 { #include-the-custom-docs }
    
    现在你可以为自定义文档创建*路径操作*。
    
    你可以复用 FastAPI 的内部函数来创建文档的 HTML 页面,并传入所需参数:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 7.1K bytes
    - Click Count (0)
  9. docs/zh-hant/docs/tutorial/dependencies/dependencies-with-yield.md

    例如,你可以用它建立一個資料庫 session,並在完成後關閉。
    
    只有 `yield` 之前(含 `yield` 本身)的程式碼會在產生回應之前執行:
    
    {* ../../docs_src/dependencies/tutorial007_py310.py hl[2:4] *}
    
    由 `yield` 產生的值會被注入到路徑操作(path operation)與其他相依中:
    
    {* ../../docs_src/dependencies/tutorial007_py310.py hl[4] *}
    
    位於 `yield` 之後的程式碼會在回應之後執行:
    
    {* ../../docs_src/dependencies/tutorial007_py310.py hl[5:6] *}
    
    /// tip
    
    你可以使用 `async` 或一般函式。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 11.9K bytes
    - Click Count (0)
  10. docs/zh/docs/advanced/settings.md

    ## 在另一个模块中放置设置 { #settings-in-another-module }
    
    你可以把这些设置放在另一个模块文件中,就像你在[更大的应用 - 多个文件](../tutorial/bigger-applications.md)中看到的那样。
    
    例如,可以有一个 `config.py` 文件:
    
    {* ../../docs_src/settings/app01_py310/config.py *}
    
    然后在 `main.py` 文件中使用它:
    
    {* ../../docs_src/settings/app01_py310/main.py hl[3,11:13] *}
    
    /// tip | 提示
    
    你还需要一个 `__init__.py` 文件,就像你在[更大的应用 - 多个文件](../tutorial/bigger-applications.md)中看到的那样。
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 10.4K bytes
    - Click Count (0)
Back to Top