Skip to main content

Werkzeug debugger middleware for Starlette

Project description

codecov version downloads license

This package contains interactive debuger middleware for Starlette / FastAPI.

Install

pip install starlette_werkzeug_debugger

Usage with Starlette

from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.routing import Route
import starlette_werkzeug_debugger


async def raise_error(request):
        local_var = 3
        raise RuntimeError("Raised error")


middleware = [
        Middleware(starlette_werkzeug_debugger.WerkzeugDebugMiddleware, evalex=True)
]


app = Starlette(debug=True, middleware=middleware, routes=[
        Route('/', raise_error),
])

Usage with FastAPI

from fastapi import FastAPI
import starlette_werkzeug_debugger


app = FastAPI()


app.add_middleware(starlette_werkzeug_debugger.WerkzeugDebugMiddleware, evalex=True)


@app.get("/")
async def raise_error():
        local_var = 3
        raise RuntimeError("Raised error")

Screenshots

https://raw.github.com/wiki/mireq/starlette-werkzeug-debugger/debugger.png?v=2023-06-20

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starlette_werkzeug_debugger-0.2.0.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page