Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 75 for we (0.21 sec)

  1. docs/en/docs/advanced/testing-database.md

    ## Create the database
    
    Because now we are going to use a new database in a new file, we need to make sure we create the database with:
    
    ```Python
    Base.metadata.create_all(bind=engine)
    ```
    
    That is normally called in `main.py`, but the line in `main.py` uses the database file `sql_app.db`, and we need to make sure we create `test.db` for the tests.
    
    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)
  2. docs/en/docs/tutorial/response-model.md

    Let's continue from the previous example. We wanted to **annotate the function with one type** but return something that includes **more data**.
    
    We want FastAPI to keep **filtering** the data using the response model.
    
    In the previous example, because the classes were different, we had to use the `response_model` parameter. But that also means that we don't get the support from the editor and tools checking the function return type.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/security/get-current-user.md

        ```
    
    But that is still not that useful.
    
    Let's make it give us the current user.
    
    ## Create a user model
    
    First, let's create a Pydantic user model.
    
    The same way we use Pydantic to declare bodies, we can use it anywhere else:
    
    === "Python 3.10+"
    
        ```Python hl_lines="5  12-16"
        {!> ../../../docs_src/security/tutorial002_an_py310.py!}
        ```
    
    === "Python 3.9+"
    
    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)
  4. docs/en/docs/advanced/generate-clients.md

    We already know that this method is related to the **items** because that word is in the `ItemsService` (taken from the tag), but we still have the tag name prefixed in the method name too. 😕
    
    We will probably still want to keep it for OpenAPI in general, as that will ensure that the operation IDs are **unique**.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/behind-a-proxy.md

    ### Check the docs UI
    
    But here's the fun part. ✨
    
    The "official" way to access the app would be through the proxy with the path prefix that we defined. So, as we would expect, if you try the docs UI served by Uvicorn directly, without the path prefix in the URL, it won't work, because it expects to be accessed through the proxy.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 11.6K bytes
    - Viewed (2)
  6. docs/en/docs/advanced/dataclasses.md

    ```{ .python .annotate hl_lines="1  5  8-11  14-17  23-25  28" }
    {!../../../docs_src/dataclasses/tutorial003.py!}
    ```
    
    1. We still import `field` from standard `dataclasses`.
    
    2. `pydantic.dataclasses` is a drop-in replacement for `dataclasses`.
    
    3. The `Author` dataclass includes a list of `Item` dataclasses.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/middleware.md

    And then you also read how to handle [CORS with the `CORSMiddleware`](../tutorial/cors.md){.internal-link target=_blank}.
    
    In this section we'll see how to use other middlewares.
    
    ## Adding ASGI middlewares
    
    As **FastAPI** is based on Starlette and implements the <abbr title="Asynchronous Server Gateway Interface">ASGI</abbr> specification, you can use any ASGI middleware.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/bigger-applications.md

    We are going to include this `APIRouter` in the main `FastAPI` app, but first, let's check the dependencies and another `APIRouter`.
    
    ## Dependencies
    
    We see that we are going to need some dependencies used in several places of the application.
    
    So we put them in their own `dependencies` module (`app/dependencies.py`).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  9. docs/en/docs/how-to/nosql-databases-couchbase.md

    ```
    
    ## Create Pydantic models
    
    As **Couchbase** "documents" are actually just "JSON objects", we can model them with Pydantic.
    
    ### `User` model
    
    First, let's create a `User` model:
    
    ```Python hl_lines="24-28"
    {!../../../docs_src/nosql_databases/tutorial001.py!}
    ```
    
    We will use this model in our *path operation function*, so, we don't include in it the `hashed_password`.
    
    ### `UserInDB` model
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/security/first-steps.md

    We can use **OAuth2** to build that with **FastAPI**.
    
    But let's save you the time of reading the full long specification just to find those little pieces of information you need.
    
    Let's use the tools provided by **FastAPI** to handle security.
    
    ## How it looks
    
    Let's first just use the code and see how it works, and then we'll come back to understand what's happening.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
Back to top