Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 62 for We (0.18 sec)

  1. docs/en/docs/tutorial/sql-databases.md

    Each instance of the `SessionLocal` class will be a database session. The class itself is not a database session yet.
    
    But once we create an instance of the `SessionLocal` class, this instance will be the actual database session.
    
    We name it `SessionLocal` to distinguish it from the `Session` we are importing from SQLAlchemy.
    
    We will use `Session` (the one imported from SQLAlchemy) later.
    
    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)
  2. docs/en/docs/advanced/settings.md

        If not provided, it's `None` by default, here we provide `"World"` as the default value to use.
    
    Then you could call that Python program:
    
    <div class="termy">
    
    ```console
    // Here we don't set the env var yet
    $ python main.py
    
    // As we didn't set the env var, we get the default value
    
    Hello World from Python
    
    // But if we create an environment variable first
    $ export MY_NAME="Wade Wilson"
    
    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)
  3. docs/en/docs/advanced/events.md

    In our code example above, we don't use it directly, but we pass it to FastAPI for it to use it.
    
    The `lifespan` parameter of the `FastAPI` app takes an **async context manager**, so we can pass our new `lifespan` async context manager to it.
    
    ```Python hl_lines="22"
    {!../../../docs_src/events/tutorial003.py!}
    ```
    
    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/tutorial/dependencies/classes-as-dependencies.md

        ```Python hl_lines="11"
        {!> ../../../docs_src/dependencies/tutorial001.py!}
        ```
    
    But then we get a `dict` in the parameter `commons` of the *path operation function*.
    
    And we know that editors can't provide a lot of support (like completion) for `dict`s, because they can't know their keys and value types.
    
    We can do better...
    
    ## What makes a dependency
    
    Up to now you have seen dependencies declared as functions.
    
    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)
  5. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  6. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  7. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  8. docs/en/docs/how-to/custom-request-and-route.md

    We can also use this same approach to access the request body in an exception handler.
    
    All we need to do is handle the request inside a `try`/`except` block:
    
    ```Python hl_lines="13  15"
    {!../../../docs_src/custom_request_and_route/tutorial002.py!}
    ```
    
    If an exception occurs, the`Request` instance will still be in scope, so we can read and make use of the request body when handling the error:
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  9. docs/en/docs/how-to/async-sql-encode-databases.md

        "completed": False,
    }
    ```
    
    but it doesn't have the `id` field.
    
    So we create a new `dict`, that contains the key-value pairs from `note.dict()` with:
    
    ```Python
    {**note.dict()}
    ```
    
    `**note.dict()` "unpacks" the key value pairs directly, so, `{**note.dict()}` would be, more or less, a copy of `note.dict()`.
    
    And then, we extend that copy `dict`, adding another key-value pair: `"id": last_record_id`:
    
    ```Python
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  10. docs/en/docs/deployment/concepts.md

    ### We Make Mistakes
    
    We, as humans, make **mistakes**, all the time. Software almost *always* has **bugs** hidden in different places. 🐛
    
    And we as developers keep improving the code as we find those bugs and as we implement new features (possibly adding new bugs too 😅).
    
    ### Small Errors Automatically Handled
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18K bytes
    - Viewed (0)
Back to top