Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 71 for informal (0.25 sec)

  1. docs/pt/docs/async.md

        Se você tem algum conhecimento técnico (corrotinas, threads, blocking etc) e está curioso sobre como o FastAPI controla o `async def` vs normal `def`, vá em frente.
    
    ### Funções de operação de rota
    
    Quando você declara uma *função de operação de rota* com `def` normal ao invés de `async def`, ela é rodada em uma threadpool externa que então é aguardada, ao invés de ser chamada diretamente (ela poderia bloquear o servidor).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 22.2K bytes
    - Viewed (0)
  2. docs/pt/docs/tutorial/background-tasks.md

    É apenas uma função padrão que pode receber parâmetros.
    
    Pode ser uma função `async def` ou `def` normal, o **FastAPI** saberá como lidar com isso corretamente.
    
    Nesse caso, a função de tarefa gravará em um arquivo (simulando o envio de um e-mail).
    
    E como a operação de gravação não usa `async` e `await`, definimos a função com `def` normal:
    
    ```Python hl_lines="6-9"
    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon May 09 23:44:32 GMT 2022
    - 5.3K bytes
    - Viewed (0)
  3. docs/pt/docs/tutorial/query-params-str-validations.md

        O `Union` em `Union[str, None]` não é usado pelo FastAPI, mas permitirá que seu editor lhe dê um melhor suporte e detecte erros.
    
    ## Validação adicional
    
    Nós iremos forçar que mesmo o parâmetro `q` seja opcional, sempre que informado, **seu tamanho não exceda 50 caracteres**.
    
    ### Importe `Query`
    
    Para isso, primeiro importe `Query` de `fastapi`:
    
    ```Python hl_lines="3"
    {!../../../docs_src/query_params_str_validations/tutorial002.py!}
    ```
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 9.3K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_testing_dependencies/test_tutorial001_an_py39.py

        assert response.status_code == 200, response.text
        assert response.json() == {
            "message": "Hello Users!",
            "params": {"q": "foo", "skip": 5, "limit": 10},
        }
    
    
    @needs_py39
    def test_normal_app():
        from docs_src.dependency_testing.tutorial001_an_py39 import app, client
    
        app.dependency_overrides = None
        response = client.get("/items/?q=foo&skip=100&limit=200")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 2K bytes
    - Viewed (0)
  5. docs/fr/docs/async.md

    ```Python
    burgers = await get_burgers(2)
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 24K bytes
    - Viewed (0)
  6. tests/test_ws_router.py

        """
        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect) as e:
            with client.websocket_connect("/no-router/"):
                pass  # pragma: no cover
        assert e.value.code == status.WS_1000_NORMAL_CLOSURE
    
    
    def websocket_middleware(middleware_func):
        """
        Helper to create a Starlette pure websocket middleware
        """
    
        def middleware_constructor(app):
            @functools.wraps(app)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  7. docs/en/docs/how-to/nosql-databases-couchbase.md

    Couchbase and we are not using the <a href="https://docs.couchbase.com/python-sdk/2.5/async-programming.html#asyncio-python-3-5" class="external-link" target="_blank">experimental Python <code>await</code> support</a>, we should declare our function with normal `def` instead of `async def`.
    
    Also, Couchbase recommends not using a single `Bucket` object in multiple "<abbr title="A sequence of code being executed by the program, while at the same time, or at intervals, there can be others being executed...
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  8. docs/pt/docs/advanced/events.md

    Você pode definir manipuladores de eventos (funções) que precisam ser executadas antes da aplicação inicializar, ou quando a aplicação estiver encerrando.
    
    Essas funções podem ser declaradas com `async def` ou `def` normal.
    
    ### Evento `startup`
    
    Para adicionar uma função que deve rodar antes da aplicação iniciar, declare-a com o evento `"startup"`:
    
    ```Python hl_lines="8"
    {!../../../docs_src/events/tutorial001.py!}
    ```
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  9. docs/de/docs/advanced/behind-a-proxy.md

    Wenn Sie gleichzeitig eine Unteranwendung mounten (wie beschrieben in [Unteranwendungen – Mounts](sub-applications.md){.internal-link target=_blank}) und einen Proxy mit `root_path` verwenden wollen, können Sie das normal tun, wie Sie es erwarten würden.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:30:07 GMT 2024
    - 13.1K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/bigger-applications.md

        * The router dependencies are executed first, then the [`dependencies` in the decorator](dependencies/dependencies-in-path-operation-decorators.md){.internal-link target=_blank}, and then the normal parameter dependencies.
        * You can also add [`Security` dependencies with `scopes`](../advanced/security/oauth2-scopes.md){.internal-link target=_blank}.
    
    !!! tip
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.6K bytes
    - Viewed (0)
Back to top