Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for finally (0.4 sec)

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

        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="15-20"
        {!> ../../../docs_src/sql_databases/sql_app/main.py!}
        ```
    
    !!! info
        我们将`SessionLocal()`请求的创建和处理放在一个`try`块中。
    
        然后我们在finally块中关闭它。
    
        通过这种方式,我们确保数据库会话在请求后始终关闭。即使在处理请求时出现异常。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 27K bytes
    - Viewed (0)
  2. docs/em/docs/tutorial/dependencies/dependencies-with-yield.md

    🚥 👆 ⚙️ `try` 🍫 🔗 ⏮️ `yield`, 👆 🔜 📨 🙆 ⚠ 👈 🚮 🕐❔ ⚙️ 🔗.
    
    🖼, 🚥 📟 ☝ 🖕, ➕1️⃣ 🔗 ⚖️ *➡ 🛠️*, ⚒ 💽 💵 "💾" ⚖️ ✍ 🙆 🎏 ❌, 👆 🔜 📨 ⚠ 👆 🔗.
    
    , 👆 💪 👀 👈 🎯 ⚠ 🔘 🔗 ⏮️ `except SomeException`.
    
    🎏 🌌, 👆 💪 ⚙️ `finally` ⚒ 💭 🚪 📶 🛠️, 🙅‍♂ 🤔 🚥 📤 ⚠ ⚖️ 🚫.
    
    ```Python hl_lines="3  5"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    ## 🎧-🔗 ⏮️ `yield`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/sql-databases.md

        ```Python hl_lines="13-18"
        {!> ../../../docs_src/sql_databases/sql_app_py39/main.py!}
        ```
    
    !!! info
        👥 🚮 🏗 `SessionLocal()` & 🚚 📨 `try` 🍫.
    
         & ⤴️ 👥 🔐 ⚫️ `finally` 🍫.
    
        👉 🌌 👥 ⚒ 💭 💽 🎉 🕧 📪 ⏮️ 📨. 🚥 📤 ⚠ ⏪ 🏭 📨.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 25.2K bytes
    - Viewed (1)
  4. docs/en/docs/async.md

    While waiting and talking to your crush, from time to time, you check the number displayed on the counter to see if it's your turn already.
    
    Then at some point, it finally is your turn. You go to the counter, get your burgers and come back to the table.
    
    <img src="/img/async/concurrent-burgers/concurrent-burgers-06.png" class="illustration">
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23K bytes
    - Viewed (0)
  5. docs/en/docs/benchmarks.md

        * You wouldn't write an application in Uvicorn directly. That would mean that your code would have to include more or less, at least, all the code provided by Starlette (or **FastAPI**). And if you did that, your final application would have the same overhead as having used a framework and minimizing your app code and bugs.
        * If you are comparing Uvicorn, compare it against Daphne, Hypercorn, uWSGI, etc. Application servers.
    * **Starlette**:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  6. fastapi/utils.py

            return True
        current_status_code = int(status_code)
        return not (current_status_code < 200 or current_status_code in {204, 205, 304})
    
    
    def get_path_param_names(path: str) -> Set[str]:
        return set(re.findall("{(.*?)}", path))
    
    
    def create_response_field(
        name: str,
        type_: Type[Any],
        class_validators: Optional[Dict[str, Validator]] = None,
        default: Optional[Any] = Undefined,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/generate-clients.md

    automatically. And if you **build** the client it will error out if you have any **mismatch** in the data used.
    
    So, you would **detect many errors** very early in the development cycle instead of having to wait for the errors to show up to your final users in production and then trying to debug where the problem is. ✨...
    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)
  8. docs/en/docs/alternatives.md

        Then APIStar stopped to exist as a server and Starlette was created, and was a new better foundation for such a system. That was the final inspiration to build **FastAPI**.
    
        I consider **FastAPI** a "spiritual successor" to APIStar, while improving and increasing the features, typing system, and other parts, based on the learnings from all these previous tools.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  9. docs/en/docs/features.md

    No more typing the wrong key names, coming back and forth between docs, or scrolling up and down to find if you finally used `username` or `user_name`.
    
    ### Short
    
    It has sensible **defaults** for everything, with optional configurations everywhere. All the parameters can be fine-tuned to do what you need and to define the API you need.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  10. docs/en/docs/release-notes.md

    ```Python
    async def do_something():
        try:
            yield something
        finally:
            some_cleanup()
    ```
    
    ...that way the `finally` block is run regardless of any exception that might happen.
    
    ### Features
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
Back to top