Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 115 for Staken (0.15 sec)

  1. docs/en/docs/tutorial/security/get-current-user.md

        ```Python hl_lines="25"
        {!> ../../../docs_src/security/tutorial002.py!}
        ```
    
    ## Get the user
    
    `get_current_user` will use a (fake) utility function we created, that takes a token as a `str` and returns our Pydantic `User` model:
    
    === "Python 3.10+"
    
        ```Python hl_lines="19-22  26-27"
        {!> ../../../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)
  2. docs/en/docs/advanced/generate-clients.md

    The generated code still has some **duplicated information**.
    
    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)
  3. docs/en/docs/tutorial/response-model.md

        "tags": []
    }
    ```
    
    FastAPI is smart enough (actually, Pydantic is smart enough) to realize that, even though `description`, `tax`, and `tags` have the same values as the defaults, they were set explicitly (instead of taken from the defaults).
    
    So, they will be included in the JSON response.
    
    !!! tip
        Notice that the default values can be anything, not only `None`.
    
        They can be a list (`[]`), a `float` of `10.5`, etc.
    
    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)
  4. docs/en/docs/tutorial/middleware.md

    * It takes each **request** that comes to your application.
    * It can then do something to that **request** or run any needed code.
    * Then it passes the **request** to be processed by the rest of the application (by some *path operation*).
    * It then takes the **response** generated by the application (by some *path operation*).
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/behind-a-proxy.md

    ```JSON
    {
        "message": "Hello World",
        "root_path": "/api/v1"
    }
    ```
    
    !!! tip
        Notice that even though you are accessing it at `http://127.0.0.1:8000/app` it shows the `root_path` of `/api/v1`, taken from the option `--root-path`.
    
    And now open the URL with the port for Traefik, including the path prefix: <a href="http://127.0.0.1:9999/api/v1/app" class="external-link" target="_blank">http://127.0.0.1:9999/api/v1/app</a>.
    
    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/reference/request.md

    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import Request
    ```
    
    !!! tip
        When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 516 bytes
    - Viewed (0)
  7. docs/zh/docs/tutorial/security/get-current-user.md

    # 获取当前用户
    
    上一章中,(基于依赖注入系统的)安全系统向*路径操作函数*传递了 `str` 类型的 `token`:
    
    ```Python hl_lines="10"
    {!../../../docs_src/security/tutorial001.py!}
    ```
    
    但这并不实用。
    
    接下来,我们学习如何返回当前用户。
    
    
    ## 创建用户模型
    
    首先,创建 Pydantic 用户模型。
    
    与使用 Pydantic 声明请求体相同,并且可在任何位置使用:
    
    ```Python hl_lines="5  12-16"
    {!../../../docs_src/security/tutorial002.py!}
    ```
    
    ## 创建 `get_current_user` 依赖项
    
    创建 `get_current_user` 依赖项。
    
    还记得依赖项支持子依赖项吗?
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:46:46 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/static-files.md

    ### What is "Mounting"
    
    "Mounting" means adding a complete "independent" application in a specific path, that then takes care of handling all the sub-paths.
    
    This is different from using an `APIRouter` as a mounted application is completely independent. The OpenAPI and docs from your main application won't include anything from the mounted application, etc.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 19:56:09 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/first-steps.md

    !!! info "`@decorator` Info"
        That `@something` syntax in Python is called a "decorator".
    
        You put it on top of a function. Like a pretty decorative hat (I guess that's where the term came from).
    
        A "decorator" takes the function below and does something with it.
    
        In our case, this decorator tells **FastAPI** that the function below corresponds to the **path** `/` with an **operation** `get`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 12K bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/security/get-current-user.md

    # 🤚 ⏮️ 👩‍💻
    
    ⏮️ 📃 💂‍♂ ⚙️ (❔ 🧢 🔛 🔗 💉 ⚙️) 🤝 *➡ 🛠️ 🔢* `token` `str`:
    
    ```Python hl_lines="10"
    {!../../../docs_src/security/tutorial001.py!}
    ```
    
    ✋️ 👈 🚫 👈 ⚠.
    
    ➡️ ⚒ ⚫️ 🤝 👥 ⏮️ 👩‍💻.
    
    ## ✍ 👩‍💻 🏷
    
    🥇, ➡️ ✍ Pydantic 👩‍💻 🏷.
    
    🎏 🌌 👥 ⚙️ Pydantic 📣 💪, 👥 💪 ⚙️ ⚫️ 🙆 🙆:
    
    === "🐍 3️⃣.6️⃣ &amp; 🔛"
    
        ```Python hl_lines="5  12-16"
        {!> ../../../docs_src/security/tutorial002.py!}
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 4.4K bytes
    - Viewed (0)
Back to top