Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 188 for You (0.16 sec)

  1. docs/en/docs/tutorial/handling-errors.md

    Let's say you have a custom exception `UnicornException` that you (or a library you use) might `raise`.
    
    And you want to handle this exception globally with FastAPI.
    
    You could add a custom exception handler with `@app.exception_handler()`:
    
    ```Python hl_lines="5-7  13-18  24"
    {!../../../docs_src/handling_errors/tutorial003.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/index.md

        And the same for each of the optional dependencies that you want to use.
    
    ## Advanced User Guide
    
    There is also an **Advanced User Guide** that you can read later after this **Tutorial - User guide**.
    
    The **Advanced User Guide**, builds on this, uses the same concepts, and teaches you some extra features.
    
    But you should first read the **Tutorial - User Guide** (what you are reading right now).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jun 24 14:47:15 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/response-cookies.md

    ## Use a `Response` parameter
    
    You can declare a parameter of type `Response` in your *path operation function*.
    
    And then you can set cookies in that *temporal* response object.
    
    ```Python hl_lines="1  8-9"
    {!../../../docs_src/response_cookies/tutorial002.py!}
    ```
    
    And then you can return any object you need, as you normally would (a `dict`, a database model, etc).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/path-params-numeric-validations.md

    And you don't need to declare anything else for that parameter, so you don't really need to use `Query`.
    
    But you still need to use `Path` for the `item_id` path parameter. And you don't want to use `Annotated` for some reason.
    
    Python will complain if you put a value with a "default" before a value that doesn't have a "default".
    
    But you can re-order them, and have the value without a default (the query parameter `q`) first.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ## Dependencies with `yield` and `HTTPException`
    
    You saw that you can use dependencies with `yield` and have `try` blocks that catch exceptions.
    
    The same way, you could raise an `HTTPException` or similar in the exit code, after the `yield`.
    
    !!! tip
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/testing-dependencies.md

    ### Use cases: external service
    
    An example could be that you have an external authentication provider that you need to call.
    
    You send it a token and it returns an authenticated user.
    
    This provider might be charging you per request, and calling it might take some extra time than if you had a fixed mock user for tests.
    
    You probably want to test the external provider once, but not necessarily call it for every test that runs.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  7. docs/en/docs/how-to/custom-docs-ui-assets.md

    But it's possible to customize it, you can set a specific CDN, or serve the files yourself.
    
    ## Custom CDN for JavaScript and CSS
    
    Let's say that you want to use a different <abbr title="Content Delivery Network">CDN</abbr>, for example you want to use `https://unpkg.com/`.
    
    This could be useful if for example you live in a country that restricts some URLs.
    
    ### Disable the automatic docs
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Oct 30 09:58:58 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/additional-responses.md

    !!! warning
        This is a rather advanced topic.
    
        If you are starting with **FastAPI**, you might not need this.
    
    You can declare additional responses, with additional status codes, media types, descriptions, etc.
    
    Those additional responses will be included in the OpenAPI schema, so they will also appear in the API docs.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/events.md

    ## Use Case
    
    Let's start with an example **use case** and then see how to solve it with this.
    
    Let's imagine that you have some **machine learning models** that you want to use to handle requests. 🤖
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/settings.md

    Next it will convert and validate the data. So, when you use that `settings` object, you will have data of the types you declared (e.g. `items_per_user` will be an `int`).
    
    ### Use the `settings`
    
    Then you can use the new `settings` object in your application:
    
    ```Python hl_lines="18-20"
    {!../../../docs_src/settings/tutorial001.py!}
    ```
    
    ### Run the server
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 15.7K bytes
    - Viewed (0)
Back to top