Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 69 for Before (0.35 sec)

  1. docs/en/docs/tutorial/middleware.md

        **FastAPI** provides it as a convenience for you, the developer. But it comes directly from Starlette.
    
    ### Before and after the `response`
    
    You can add code to be run with the `request`,  before any *path operation* receives it.
    
    And also after the `response` is generated, before returning it.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  2. docs_src/custom_request_and_route/tutorial003.py

            original_route_handler = super().get_route_handler()
    
            async def custom_route_handler(request: Request) -> Response:
                before = time.time()
                response: Response = await original_route_handler(request)
                duration = time.time() - before
                response.headers["X-Response-Time"] = str(duration)
                print(f"route duration: {duration}")
                print(f"route response: {response}")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 1K bytes
    - Viewed (0)
  3. docs/en/docs/alternatives.md

    Without a data validation system, you would have to do all the checks by hand, in code.
    
    These features are what Marshmallow was built to provide. It is a great library, and I have used it a lot before.
    
    But it was created before there existed Python type hints. So, to define every <abbr title="the definition of how data should be formed">schema</abbr> you need to use specific utils and classes provided by Marshmallow.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_response_change_status_code/test_tutorial001.py

        assert response.json() == "Listen to the Bar Fighters"
        response = client.put("/get-or-create-task/bar")
        assert response.status_code == 201, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 521 bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/testing.md

    {!../../../docs_src/app_testing/test_main.py!}
    ```
    
    ...and have the code for the tests just like before.
    
    ## Testing: extended example
    
    Now let's extend this example and add more details to see how to test different parts.
    
    ### Extended **FastAPI** app file
    
    Let's continue with the same file structure as before:
    
    ```
    .
    ├── app
    │   ├── __init__.py
    │   ├── main.py
    │   └── test_main.py
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/security/get-current-user.md

    Let's create a dependency `get_current_user`.
    
    Remember that dependencies can have sub-dependencies?
    
    `get_current_user` will have a dependency with the same `oauth2_scheme` we created before.
    
    The same as we were doing before in the *path operation* directly, our new dependency `get_current_user` will receive a `token` as a `str` from the sub-dependency `oauth2_scheme`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="25"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/path-params.md

    And then you can also have a path `/users/{user_id}` to get data about a specific user by some user ID.
    
    Because *path operations* are evaluated in order, you need to make sure that the path for `/users/me` is declared before the one for `/users/{user_id}`:
    
    ```Python hl_lines="6  11"
    {!../../../docs_src/path_params/tutorial003.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  8. docs/en/docs/deployment/https.md

        * So, the **certificate and encryption** handling is done **before HTTP**.
    * **TCP doesn't know about "domains"**. Only about IP addresses.
        * The information about the **specific domain** requested goes in the **HTTP data**.
    * The **HTTPS certificates** "certify" a **certain domain**, but the protocol and encryption happen at the TCP level, **before knowing** which domain is being dealt with.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 12K bytes
    - Viewed (0)
  9. docs/en/docs/deployment/concepts.md

    ## Previous Steps Before Starting
    
    There are many cases where you want to perform some steps **before starting** your application.
    
    For example, you might want to run **database migrations**.
    
    But in most cases, you will want to perform these steps only **once**.
    
    So, you will want to have a **single process** to perform those **previous steps**, before starting the application.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 18K bytes
    - Viewed (0)
  10. docs/en/docs/deployment/manually.md

    * Security - HTTPS
    * Running on startup
    * Restarts
    * Replication (the number of processes running)
    * Memory
    * Previous steps before starting
    
    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)
Back to top