Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 147 for Krause (0.19 sec)

  1. tests/test_tutorial/test_dependencies/test_tutorial008d_an_py39.py

        )
    
    
    @needs_py39
    def test_internal_server_error():
        from docs_src.dependencies.tutorial008d_an_py39 import app
    
        client = TestClient(app, raise_server_exceptions=False)
        response = client.get("/items/portal-gun")
        assert response.status_code == 500, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  2. fastapi/concurrency.py

        except Exception as e:
            ok = bool(
                await anyio.to_thread.run_sync(
                    cm.__exit__, type(e), e, None, limiter=exit_limiter
                )
            )
            if not ok:
                raise e
        else:
            await anyio.to_thread.run_sync(
                cm.__exit__, None, None, None, limiter=exit_limiter
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Dec 25 17:57:35 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/security/oauth2-scopes.md

    The `security_scopes` object (of class `SecurityScopes`) also provides a `scope_str` attribute with a single string, containing those scopes separated by spaces (we are going to use it).
    
    We create an `HTTPException` that we can re-use (`raise`) later at several points.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 20.5K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

    路径装饰器依赖项也可以使用普通的依赖项*函数*。
    
    ### 依赖项的需求项
    
    路径装饰器依赖项可以声明请求的需求项(比如响应头)或其他子依赖项:
    
    ```Python hl_lines="6  11"
    {!../../../docs_src/dependencies/tutorial006.py!}
    ```
    
    ### 触发异常
    
    路径装饰器依赖项与正常的依赖项一样,可以 `raise` 异常:
    
    ```Python hl_lines="8  13"
    {!../../../docs_src/dependencies/tutorial006.py!}
    ```
    
    ### 返回值
    
    无论路径装饰器依赖项是否返回值,路径操作都不会使用这些值。
    
    因此,可以复用在其他位置使用过的、(能返回值的)普通依赖项,即使没有使用这个值,也会执行该依赖项:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 2.7K bytes
    - Viewed (0)
  5. docs/en/docs/async.md

    But then, even though you still don't have your burgers, your work with the cashier is "on pause" ⏸, because you have to wait 🕙 for your burgers to be ready.
    
    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)
  6. fastapi/applications.py

                        valid, that would mean a violation of the contract with the client,
                        so it's an error from the API developer. So, FastAPI will raise an
                        error and return a 500 error code (Internal Server Error).
    
                    Read more about it in the
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  7. docs/fr/docs/contributing.md

    ##### Nouvelle langue non prise en charge
    
    Si, lors de l'exécution du script du serveur en direct, vous obtenez une erreur indiquant que la langue n'est pas prise en charge, quelque chose comme :
    
    ```
     raise TemplateNotFound(template)
    jinja2.exceptions.TemplateNotFound: partials/language/xx.html
    ```
    
    Cela signifie que le thème ne supporte pas cette langue (dans ce cas, avec un faux code de 2 lettres de `xx`).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jul 27 18:51:07 GMT 2023
    - 16.3K bytes
    - Viewed (0)
  8. docs/en/docs/how-to/sql-databases-peewee.md

    So, in our case, if we set the Peewee state variable (with a default `dict`) in the `async` dependency, all the rest of the internal code in our app will see this value and will be able to reuse it for the whole request.
    
    And the context variable would be set again for the next request, even if they are concurrent.
    
    ### Set database state in the dependency `get_db()`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (1)
  9. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

        Note over client,operation: Can raise exceptions, including HTTPException
        client ->> dep: Start request
        Note over dep: Run code up to yield
        opt raise Exception
            dep -->> handler: Raise Exception
            handler -->> client: HTTP error response
        end
        dep ->> operation: Run dependency, e.g. DB session
        opt raise
            operation -->> dep: Raise Exception (e.g. HTTPException)
            opt handle
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  10. docs_src/app_testing/app_b_py310/main.py

        if x_token != fake_secret_token:
            raise HTTPException(status_code=400, detail="Invalid X-Token header")
        if item_id not in fake_db:
            raise HTTPException(status_code=404, detail="Item not found")
        return fake_db[item_id]
    
    
    @app.post("/items/", response_model=Item)
    async def create_item(item: Item, x_token: str = Header()):
        if x_token != fake_secret_token:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 09 14:44:08 GMT 2024
    - 1.1K bytes
    - Viewed (0)
Back to top