Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 587 for _settings (0.2 sec)

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

    #### `lru_cache` Technical Details
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 15.7K bytes
    - Viewed (0)
  2. docs/de/docs/advanced/settings.md

        ```Python hl_lines="1  10"
        {!> ../../../docs_src/settings/app03/main.py!}
        ```
    
    Dann wird bei allen nachfolgenden Aufrufen von `get_settings()`, in den Abhängigkeiten für darauffolgende Requests, dasselbe Objekt zurückgegeben, das beim ersten Aufruf zurückgegeben wurde, anstatt den Code von `get_settings()` erneut auszuführen und ein neues `Settings`-Objekt zu erstellen.
    
    #### Technische Details zu `lru_cache`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:17:14 GMT 2024
    - 17.8K bytes
    - Viewed (0)
  3. docs/zh/docs/advanced/settings.md

        ```Python hl_lines="1  11"
        {!> ../../../docs_src/settings/app03_an/main.py!}
        ```
    
    === "Python 3.8+ 非注解版本"
    
        !!! tip
            如果可能,请尽量使用 `Annotated` 版本。
    
        ```Python hl_lines="1  10"
        {!> ../../../docs_src/settings/app03/main.py!}
        ```
    
    然后,在下一次请求的依赖项中对 `get_settings()` 进行任何后续调用时,它不会执行 `get_settings()` 的内部代码并创建新的 `Settings` 对象,而是返回在第一次调用时返回的相同对象,一次又一次。
    
    #### `lru_cache` 技术细节
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 13.9K bytes
    - Viewed (0)
  4. docs/em/docs/advanced/settings.md

    {!../../../docs_src/settings/app02/main.py!}
    ```
    
    !!! tip
        👥 🔜 🔬 `@lru_cache` 🍖.
    
        🔜 👆 💪 🤔 `get_settings()` 😐 🔢.
    
    & ⤴️ 👥 💪 🚚 ⚫️ ⚪️➡️ *➡ 🛠️ 🔢* 🔗 & ⚙️ ⚫️ 🙆 👥 💪 ⚫️.
    
    ```Python hl_lines="16  18-20"
    {!../../../docs_src/settings/app02/main.py!}
    ```
    
    ### ⚒ & 🔬
    
    ⤴️ ⚫️ 🔜 📶 ⏩ 🚚 🎏 ⚒ 🎚 ⏮️ 🔬 🏗 🔗 🔐 `get_settings`:
    
    ```Python hl_lines="9-10  13  21"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/http2/FrameLogTest.kt

        assertThat(frameLog(false, 3, 100, TYPE_HEADERS, FLAG_END_HEADERS))
          .isEqualTo(">> 0x00000003   100 HEADERS       END_HEADERS")
        assertThat(frameLog(false, 3, 0, TYPE_DATA, FLAG_END_STREAM))
          .isEqualTo(">> 0x00000003     0 DATA          END_STREAM")
        assertThat(frameLog(true, 0, 15, TYPE_SETTINGS, FLAG_NONE))
          .isEqualTo("<< 0x00000000    15 SETTINGS      ")
        assertThat(frameLog(false, 0, 0, TYPE_SETTINGS, FLAG_ACK))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  6. docs_src/settings/app03_an_py39/main.py

    from . import config
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return config.Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[config.Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
            "items_per_user": settings.items_per_user,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 462 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_settings/test_app02.py

    
    @needs_pydanticv2
    def test_settings(monkeypatch: MonkeyPatch):
        from docs_src.settings.app02 import main
    
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        settings = main.get_settings()
        assert settings.app_name == "Awesome API"
        assert settings.items_per_user == 50
    
    
    @needs_pydanticv2
    def test_override_settings():
        from docs_src.settings.app02 import test_main
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 488 bytes
    - Viewed (0)
  8. docs_src/settings/app02_an/main.py

    from typing_extensions import Annotated
    
    from .config import Settings
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
            "items_per_user": settings.items_per_user,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 456 bytes
    - Viewed (0)
  9. docs_src/settings/app03_an/main.py

    from . import config
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return config.Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[config.Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
            "items_per_user": settings.items_per_user,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 451 bytes
    - Viewed (0)
  10. docs_src/settings/app03/main.py

    from . import config
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return config.Settings()
    
    
    @app.get("/info")
    async def info(settings: config.Settings = Depends(get_settings)):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
            "items_per_user": settings.items_per_user,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 412 bytes
    - Viewed (0)
Back to top