Introduction
A debug toolbar for FastAPI based on the original django-debug-toolbar.
Swagger UI & GraphQL are supported.
Installation
pip install fastapi-debug-toolbar
Info
The following packages are automatically installed:
- Jinja2 for toolbar templates.
- pyinstrument for profiling support.
Quickstart
Add DebugToolbarMiddleware
middleware to your FastAPI application:
from debug_toolbar.middleware import DebugToolbarMiddleware
from fastapi import FastAPI
app = FastAPI(debug=True)
app.add_middleware(DebugToolbarMiddleware)
How it works
Once installed, the debug toolbar tab is displayed on the right side of any html page, just click on it to open the navbar.
The debug toolbar can be used with Swagger UI or GraphiQL and it is automatically updated after any request using a cookie-based system.