This package contains interactive debuger middleware for Starlette / FastAPI.
pip install starlette_werkzeug_debugger
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),
])
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")