Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 204 for defa (0.02 sec)

  1. docs/es/docs/index.md

    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    <summary>O usa <code>async def</code>...</summary>
    
    Si tu código usa `async` / `await`, usa `async def`:
    
    ```Python hl_lines="9  14"
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:49:48 UTC 2025
    - 21.5K bytes
    - Viewed (0)
  2. docs/nl/docs/index.md

    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    <summary>Of maak gebruik van <code>async def</code>...</summary>
    
    Als je code gebruik maakt van `async` / `await`, gebruik dan `async def`:
    
    ```Python hl_lines="9  14"
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:49:48 UTC 2025
    - 21.2K bytes
    - Viewed (0)
  3. docs/pt/docs/index.md

    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    <summary>Ou use <code>async def</code>...</summary>
    
    Se seu código utiliza `async` / `await`, use `async def`:
    
    ```Python hl_lines="9  14"
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:49:48 UTC 2025
    - 21.6K bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/first-steps.md

    **FastAPI** будет вызывать её каждый раз при получении `GET` запроса к URL "`/`".
    
    В данном случае это асинхронная функция.
    
    ---
    
    Вы также можете определить ее как обычную функцию вместо `async def`:
    
    {* ../../docs_src/first_steps/tutorial003.py hl[7] *}
    
    /// note | Технические детали
    
    Если не знаете в чём разница, посмотрите [Конкурентность: *"Нет времени?"*](../async.md#_1){.internal-link target=_blank}.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 12.9K bytes
    - Viewed (0)
  5. docs/es/docs/advanced/events.md

    Puedes definir manejadores de eventos (funciones) que necesitan ser ejecutadas antes de que la aplicación se inicie, o cuando la aplicación se está cerrando.
    
    Estas funciones pueden ser declaradas con `async def` o `def` normal.
    
    ### Evento `startup`
    
    Para añadir una función que debería ejecutarse antes de que la aplicación inicie, declárala con el evento `"startup"`:
    
    {* ../../docs_src/events/tutorial001.py hl[8] *}
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Dec 30 18:26:57 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  6. docs/ko/docs/tutorial/dependencies/index.md

    ## `async`하게, 혹은 `async`하지 않게
    
    의존성이 (*경로 작동 함수*에서 처럼 똑같이) **FastAPI**에 의해 호출될 수 있으며, 함수를 정의할 때 동일한 규칙이 적용됩니다.
    
    `async def`을 사용하거나 혹은 일반적인 `def`를 사용할 수 있습니다.
    
    그리고 일반적인 `def` *경로 작동 함수* 안에 `async def`로 의존성을 선언할 수 있으며, `async def` *경로 작동 함수* 안에 `def`로 의존성을 선언하는 등의 방법이 있습니다.
    
    아무 문제 없습니다. **FastAPI**는 무엇을 할지 알고 있습니다.
    
    /// note | 참고
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  7. docs/zh-hant/docs/index.md

    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    <summary>或可以使用 <code>async def</code>...</summary>
    
    如果你的程式使用 `async` / `await`,請使用 `async def`:
    
    ```Python hl_lines="9  14"
    from typing import Union
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:49:48 UTC 2025
    - 18.8K bytes
    - Viewed (0)
  8. docs/fr/docs/python-types.md

    Mais même si vous n'utilisez pas ou n'utiliserez jamais **FastAPI**, vous pourriez bénéficier d'apprendre quelques choses sur ces dernières.
    
    /// note
    
    Si vous êtes un expert Python, et que vous savez déjà **tout** sur les annotations de type, passez au chapitre suivant.
    
    ///
    
    ## Motivations
    
    Prenons un exemple simple :
    
    {*../../docs_src/python_types/tutorial001.py*}
    
    Exécuter ce programe affiche :
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sat Nov 09 16:39:20 UTC 2024
    - 10K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/dependencies/sub-dependencies.md

    //// tab | Python 3.6+
    
    ```Python hl_lines="1"
    async def needy_dependency(fresh_value: Annotated[str, Depends(get_value, use_cache=False)]):
        return {"fresh_value": fresh_value}
    ```
    
    ////
    
    //// tab | Python 3.6+ без Annotated
    
    /// tip | Подсказка
    
    Предпочтительнее использовать версию с аннотацией, если это возможно.
    
    ///
    
    ```Python hl_lines="1"
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  10. README.md

    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    <summary>Or use <code>async def</code>...</summary>
    
    If your code uses `async` / `await`, use `async def`:
    
    ```Python hl_lines="9  14"
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 15:19:49 UTC 2025
    - 24.3K bytes
    - Viewed (0)
Back to top