Search Options

Results per page
Sort
Preferred Languages
Advance

Results 661 - 670 of 877 for tutorial002 (0.07 sec)

  1. docs/zh/docs/advanced/testing-events.md

    # 测试事件:启动 - 关闭
    
    使用 `TestClient` 和 `with` 语句,在测试中运行事件处理器(`startup` 与 `shutdown`)。
    
    ```Python hl_lines="9-12  20-24"
    {!../../docs_src/app_testing/tutorial003.py!}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 225 bytes
    - Viewed (0)
  2. scripts/playwright/query_param_models/image01.py

        # ---------------------
        context.close()
        browser.close()
    
    
    process = subprocess.Popen(
        ["fastapi", "run", "docs_src/query_param_models/tutorial001.py"]
    )
    try:
        for _ in range(3):
            try:
                response = httpx.get("http://localhost:8000/docs")
            except httpx.ConnectError:
                time.sleep(1)
                break
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  3. docs/tr/docs/advanced/wsgi.md

    `WSGIMiddleware`'ı projenize dahil edin.
    
    Ardından WSGI (örneğin Flask) uygulamanızı middleware ile sarmalayın.
    
    Son olarak da bir yol altında bağlama işlemini gerçekleştirin.
    
    ```Python hl_lines="2-3  23"
    {!../../docs_src/wsgi/tutorial001.py!}
    ```
    
    ## Kontrol Edelim
    
    Artık `/v1/` yolunun altındaki her istek Flask uygulaması tarafından işlenecektir.
    
    Geri kalanı ise **FastAPI** tarafından işlenecektir.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/testing-events.md

    When you need your event handlers (`startup` and `shutdown`) to run in your tests, you can use the `TestClient` with a `with` statement:
    
    ```Python hl_lines="9-12  20-24"
    {!../../docs_src/app_testing/tutorial003.py!}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 259 bytes
    - Viewed (0)
  5. docs/em/docs/advanced/wsgi.md

    ## ⚙️ `WSGIMiddleware`
    
    👆 💪 🗄 `WSGIMiddleware`.
    
    ⤴️ 🎁 🇨🇻 (✅ 🏺) 📱 ⏮️ 🛠️.
    
    & ⤴️ 🗻 👈 🔽 ➡.
    
    ```Python hl_lines="2-3  22"
    {!../../docs_src/wsgi/tutorial001.py!}
    ```
    
    ## ✅ ⚫️
    
    🔜, 🔠 📨 🔽 ➡ `/v1/` 🔜 🍵 🏺 🈸.
    
    & 🎂 🔜 🍵 **FastAPI**.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/openapi-callbacks.md

    This part is pretty normal, most of the code is probably already familiar to you:
    
    ```Python hl_lines="9-13  36-53"
    {!../../docs_src/openapi_callbacks/tutorial001.py!}
    ```
    
    /// tip
    
    The `callback_url` query parameter uses a Pydantic <a href="https://docs.pydantic.dev/latest/api/networks/" class="external-link" target="_blank">Url</a> type.
    
    ///
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  7. docs/pt/docs/advanced/openapi-callbacks.md

    Essa parte é bastante normal, a maior parte do código provavelmente já é familiar para você:
    
    ```Python hl_lines="9-13  36-53"
    {!../../docs_src/openapi_callbacks/tutorial001.py!}
    ```
    
    /// tip | Dica
    
    O parâmetro de consulta `callback_url` usa um tipo Pydantic <a href="https://docs.pydantic.dev/latest/api/networks/" class="external-link" target="_blank">Url</a>.
    
    ///
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 30 19:53:03 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/request-forms.md

    ```
    
    ////
    
    //// tab | Python 3.8+ non-Annotated
    
    /// tip
    
    Prefer to use the `Annotated` version if possible.
    
    ///
    
    ```Python hl_lines="1"
    {!> ../../docs_src/request_forms/tutorial001.py!}
    ```
    
    ////
    
    ## Define `Form` parameters
    
    Create form parameters the same way you would for `Body` or `Query`:
    
    //// tab | Python 3.9+
    
    ```Python hl_lines="9"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/wsgi.md

    ## Using `WSGIMiddleware`
    
    You need to import `WSGIMiddleware`.
    
    Then wrap the WSGI (e.g. Flask) app with the middleware.
    
    And then mount that under a path.
    
    ```Python hl_lines="2-3  23"
    {!../../docs_src/wsgi/tutorial001.py!}
    ```
    
    ## Check it
    
    Now, every request under the path `/v1/` will be handled by the Flask application.
    
    And the rest will be handled by **FastAPI**.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_events/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.events.tutorial003 import (
        app,
        fake_answer_to_everything_ml_model,
        ml_models,
    )
    
    
    def test_events():
        assert not ml_models, "ml_models should be empty"
        with TestClient(app) as client:
            assert ml_models["answer_to_everything"] == fake_answer_to_everything_ml_model
            response = client.get("/predict", params={"x": 2})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.6K bytes
    - Viewed (0)
Back to top