Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 58 for Sanders (0.15 sec)

  1. docs_src/events/tutorial001.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    items = {}
    
    
    @app.on_event("startup")
    async def startup_event():
        items["foo"] = {"name": "Fighters"}
        items["bar"] = {"name": "Tenders"}
    
    
    @app.get("/items/{item_id}")
    async def read_items(item_id: str):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 283 bytes
    - Viewed (0)
  2. docs/en/docs/advanced/testing-events.md

    # Testing Events: startup - shutdown
    
    When you need your event handlers (`startup` and `shutdown`) to run in your tests, you can use the `TestClient` with a `with` statement:
    
    ```Python hl_lines="9-12  20-24"
    {!../../../docs_src/app_testing/tutorial003.py!}
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 29 14:02:58 GMT 2020
    - 262 bytes
    - Viewed (0)
  3. docs_src/handling_errors/tutorial006.py

    from fastapi import FastAPI, HTTPException
    from fastapi.exception_handlers import (
        http_exception_handler,
        request_validation_exception_handler,
    )
    from fastapi.exceptions import RequestValidationError
    from starlette.exceptions import HTTPException as StarletteHTTPException
    
    app = FastAPI()
    
    
    @app.exception_handler(StarletteHTTPException)
    async def custom_http_exception_handler(request, exc):
        print(f"OMG! An HTTP error!: {repr(exc)}")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Aug 09 11:10:33 GMT 2020
    - 928 bytes
    - Viewed (0)
  4. docs/de/docs/tutorial/middleware.md

    ```Python hl_lines="10  12-13"
    {!../../../docs_src/middleware/tutorial001.py!}
    ```
    
    ## Andere Middlewares
    
    Sie können später mehr über andere Middlewares in [Handbuch für fortgeschrittene Benutzer: Fortgeschrittene Middleware](../advanced/middleware.md){.internal-link target=_blank} lesen.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 23 11:26:59 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  5. docs/de/docs/benchmarks.md

        * Wenn Sie FastAPI nicht, und direkt Starlette (oder ein anderes Tool wie Sanic, Flask, Responder, usw.) verwenden würden, müssten Sie die gesamte Datenvalidierung und Serialisierung selbst implementieren. Ihre finale Anwendung hätte also immer noch den gleichen Overhead, als ob sie mit FastAPI erstellt worden...
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 23 16:04:13 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_additional_responses/test_tutorial003.py

                                        "example": {
                                            "id": "bar",
                                            "value": "The bar tenders",
                                        },
                                    }
                                },
                            },
                            "422": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/middleware.md

    new_app = UnicornMiddleware(app, some_config="rainbow")
    ```
    
    But FastAPI (actually Starlette) provides a simpler way to do it that makes sure that the internal middlewares to handle server errors and custom exception handlers work properly.
    
    For that, you use `app.add_middleware()` (as in the example for CORS).
    
    ```Python
    from fastapi import FastAPI
    from unicorn import UnicornMiddleware
    
    app = FastAPI()
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
  8. docs/de/docs/project-generation.md

    * **Azure DevOps** Kubernetes (AKS) CI/CD-Deployment integriert.
    * **Mehrsprachig** Wählen Sie bei der Projekteinrichtung ganz einfach eine der integrierten Sprachen von spaCy aus.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:14:36 GMT 2024
    - 6.5K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/dependencies/sub-dependencies.md

        {!> ../../../docs_src/dependencies/tutorial005.py!}
        ```
    
    Betrachten wir die deklarierten Parameter:
    
    * Obwohl diese Funktion selbst eine Abhängigkeit ist („Dependable“, etwas hängt von ihr ab), deklariert sie auch eine andere Abhängigkeit („Dependant“, sie hängt von etwas anderem ab).
        * Sie hängt von `query_extractor` ab und weist den von diesem zurückgegebenen Wert dem Parameter `q` zu.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:09:48 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/handling-errors.md

    ```Python
    from starlette.exceptions import HTTPException as StarletteHTTPException
    
    ```
    
    ### 复用 **FastAPI** 异常处理器
    
    FastAPI 支持先对异常进行某些处理,然后再使用 **FastAPI** 中处理该异常的默认异常处理器。
    
    从 `fastapi.exception_handlers` 中导入要复用的默认异常处理器:
    
    ```Python hl_lines="2-5  15  21"
    {!../../../docs_src/handling_errors/tutorial006.py!}
    
    ```
    
    虽然,本例只是输出了夸大其词的错误信息。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
Back to top