Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 46 for Magnin (0.17 sec)

  1. docs/en/docs/advanced/settings.md

    #### `lru_cache` Technical Details
    
    `@lru_cache` modifies the function it decorates to return the same value that was returned the first time, instead of computing it again, executing the code of the function every time.
    
    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)
  2. docs_src/dependencies/tutorial008c_an_py39.py

    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 700 bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ## Dependencies with `yield` and `except`
    
    If you catch an exception using `except` in a dependency with `yield` and you don't raise it again (or raise a new exception), FastAPI won't be able to notice there was an exception, the same way that would happen with regular Python:
    
    === "Python 3.9+"
    
        ```Python hl_lines="15-16"
    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)
  4. docs/en/docs/how-to/custom-docs-ui-assets.md

    {!../../../docs_src/custom_docs_ui/tutorial002.py!}
    ```
    
    ### Include the custom docs for static files
    
    And the same way as with a custom CDN, now you can create the *path operations* for the custom docs.
    
    Again, you can re-use FastAPI's internal functions to create the HTML pages for the docs, and pass them the needed arguments:
    
    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)
  5. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

        ```Python
        commons: CommonQueryParams = Depends()
        ```
    
    You declare the dependency as the type of the parameter, and you use `Depends()` without any parameter, instead of having to write the full class *again* inside of `Depends(CommonQueryParams)`.
    
    The same example would then look like:
    
    === "Python 3.10+"
    
        ```Python hl_lines="19"
        {!> ../../../docs_src/dependencies/tutorial004_an_py310.py!}
        ```
    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)
  6. docs_src/dependencies/tutorial008c.py

    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
            raise InternalError(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 660 bytes
    - Viewed (0)
  7. docs/en/docs/advanced/security/http-basic-auth.md

    And then they can try again knowing that it's probably something more similar to `stanleyjobsox` than to `johndoe`.
    
    #### A "professional" attack
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 14:33:05 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  8. docs/en/docs/async.md

    So, during that time, the computer can go and do some other work, while "slow-file" πŸ“ finishes.
    
    Then the computer / program πŸ€– will come back every time it has a chance because it's waiting again, or whenever it πŸ€– finished all the work it had at that point. And it πŸ€– will see if any of the tasks it was waiting for have already finished, doing whatever it had to do.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23K bytes
    - Viewed (0)
  9. docs/en/docs/how-to/sql-databases-peewee.md

    ```Python hl_lines="18-20"
    {!../../../docs_src/sql_databases_peewee/sql_app/main.py!}
    ```
    
    For the **next request**, as we will reset that context variable again in the `async` dependency `reset_db_state()` and then create a new connection in the `get_db()` dependency, that new request will have its own database state (connection, transactions, etc).
    
    !!! tip
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/dependencies/sub-dependencies.md

    πŸš₯ 1️⃣ πŸ‘† πŸ”— πŸ“£ πŸ’— πŸ•° 🎏 *➑ πŸ› οΈ*, πŸ–Ό, πŸ’— πŸ”— βœ”οΈ ⚠ 🎧-πŸ”—, **FastAPI** πŸ”œ πŸ’­ πŸ€™ πŸ‘ˆ 🎧-πŸ”— πŸ•΄ πŸ• πŸ“ πŸ“¨.
    
    &amp; ⚫️ πŸ”œ πŸ–Š πŸ“¨ πŸ’² <abbr title="A utility/system to store computed/generated values, to re-use them instead of computing them again.">"πŸ’Ύ"</abbr> &amp; πŸšΆβ€β™€οΈ ⚫️ 🌐 "βš“οΈ" πŸ‘ˆ πŸ’ͺ ⚫️ πŸ‘ˆ 🎯 πŸ“¨, ↩️ πŸ€™ πŸ”— πŸ’— πŸ•° 🎏 πŸ“¨.
    
    🏧 😐 πŸŒβ” πŸ‘† πŸ’­ πŸ‘† πŸ’ͺ πŸ”— πŸ€™ πŸ”  πŸ” (🎲 πŸ’— πŸ•°) 🎏 πŸ“¨ ↩️ βš™οΈ "πŸ’Ύ" πŸ’², πŸ‘† πŸ’ͺ βš’ πŸ”’ `use_cache=False` πŸ•β” βš™οΈ `Depends`:
    
    ```Python hl_lines="1"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 3.3K bytes
    - Viewed (0)
Back to top