Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 103 for You (0.14 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/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)
  3. 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)
  4. 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)
  5. docs/en/docs/how-to/configure-swagger-ui.md

        SwaggerUIBundle.SwaggerUIStandalonePreset
    ]
    ```
    
    These are **JavaScript** objects, not strings, so you can't pass them from Python code directly.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/wsgi.md

    # Including WSGI - Flask, Django, others
    
    You can mount WSGI applications as you saw with [Sub Applications - Mounts](sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](behind-a-proxy.md){.internal-link target=_blank}.
    
    For that, you can use the `WSGIMiddleware` and use it to wrap your WSGI application, for example, Flask, Django, etc.
    
    ## Using `WSGIMiddleware`
    
    You need to import `WSGIMiddleware`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/sql-databases.md

    **FastAPI** doesn't require you to use a SQL (relational) database.
    
    But you can use any relational database that you want.
    
    Here we'll see an example using <a href="https://www.sqlalchemy.org/" class="external-link" target="_blank">SQLAlchemy</a>.
    
    You can easily adapt it to any database supported by SQLAlchemy, like:
    
    * PostgreSQL
    * MySQL
    * SQLite
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

    ## Classes as dependencies
    
    You might notice that to create an instance of a Python class, you use that same syntax.
    
    For example:
    
    ```Python
    class Cat:
        def __init__(self, name: str):
            self.name = name
    
    
    fluffy = Cat(name="Mr Fluffy")
    ```
    
    In this case, `fluffy` is an instance of the class `Cat`.
    
    And to create `fluffy`, you are "calling" `Cat`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  9. docs/en/docs/reference/response.md

    # `Response` class
    
    You can declare a parameter in a *path operation function* or dependency to be of type `Response` and then you can set data for the response like headers or cookies.
    
    You can also use it directly to create an instance of it and return it from your *path operations*.
    
    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import Response
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 397 bytes
    - Viewed (0)
  10. docs/en/docs/index.md

    ![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
    
    ### Recap
    
    In summary, you declare **once** the types of parameters, body, etc. as function parameters.
    
    You do that with standard modern Python types.
    
    You don't have to learn a new syntax, the methods or classes of a specific library, etc.
    
    Just standard **Python 3.8+**.
    
    For example, for an `int`:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 23:58:47 GMT 2024
    - 19.2K bytes
    - Viewed (0)
Back to top