Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 255 for Turing (0.18 sec)

  1. docs/zh/docs/advanced/using-request-directly.md

    不过,仍可以验证、转换与注释(使用 Pydantic 模型的请求体等)其它正常声明的参数。
    
    但在某些特定情况下,还是需要提取 `Request` 对象。
    
    ## 直接使用 `Request` 对象
    
    假设要在*路径操作函数*中获取客户端 IP 地址和主机。
    
    此时,需要直接访问请求。
    
    ```Python hl_lines="1  7-8"
    {!../../../docs_src/using_request_directly/tutorial001.py!}
    ```
    
    把*路径操作函数*的参数类型声明为 `Request`,**FastAPI** 就能把 `Request` 传递到参数里。
    
    !!! tip "提示"
    
        注意,本例除了声明请求参数之外,还声明了路径参数。
    
        因此,能够提取、验证路径参数、并转换为指定类型,还可以用 OpenAPI 注释。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:44:02 GMT 2024
    - 2K bytes
    - Viewed (0)
  2. docs/en/docs/deployment/manually.md

        ```Python
        from main import app
        ```
    
    !!! warning
        Uvicorn and others support a `--reload` option that is useful during development.
    
        The `--reload` option consumes much more resources, is more unstable, etc.
    
        It helps a lot during **development**, but you **shouldn't** use it in **production**.
    
    ## Hypercorn with Trio
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py

                                        "maxLength": 50,
                                        "minLength": 3,
                                        "pattern": "^fixedquery$",
                                        "type": "string",
                                        "description": "Query string for the items to search in the database that have a good match",
                                    }
                                ),
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_extra_data_types/test_tutorial001.py

                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                        },
                    },
                    "HTTPValidationError": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_extra_models/test_tutorial003_py310.py

                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                        },
                    },
                    "HTTPValidationError": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_additional_responses/test_tutorial001.py

                            "id": {"title": "Id", "type": "string"},
                            "value": {"title": "Value", "type": "string"},
                        },
                    },
                    "Message": {
                        "title": "Message",
                        "required": ["message"],
                        "type": "object",
                        "properties": {"message": {"title": "Message", "type": "string"}},
                    },
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/testing-database.md

    We'll use an in-memory database that persists during the tests instead of the local file `sql_app.db`.
    
    But the rest of the session code is more or less the same, we just copy it.
    
    ```Python hl_lines="8-13"
    {!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
    ```
    
    !!! tip
        You could reduce duplication in that code by putting it in a function and using it from both `database.py` and `tests/test_sql_app.py`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_additional_responses/test_tutorial003.py

                            "id": {"title": "Id", "type": "string"},
                            "value": {"title": "Value", "type": "string"},
                        },
                    },
                    "Message": {
                        "title": "Message",
                        "required": ["message"],
                        "type": "object",
                        "properties": {"message": {"title": "Message", "type": "string"}},
                    },
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_query_params/test_tutorial006_py310.py

                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                        },
                    },
                    "HTTPValidationError": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_dependencies/test_tutorial001_an.py

                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                        },
                    },
                    "HTTPValidationError": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 7.1K bytes
    - Viewed (0)
Back to top