Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mongkok/fastapi-debug-toolbar

A debug toolbar for FastAPI.
https://github.com/mongkok/fastapi-debug-toolbar

ariadne debug fastapi graphene graphql profiling pyinstrument sqlalchemy swagger tortoise-orm

Last synced: about 9 hours ago
JSON representation

A debug toolbar for FastAPI.

Awesome Lists containing this project

README

        

# ![FastAPI](https://raw.githubusercontent.com/mongkok/fastapi-debug-toolbar/main/debug_toolbar/statics/img/icon-green.svg) Debug Toolbar



FastAPI Debug Toolbar



🐞A debug toolbar for FastAPI based on the original django-debug-toolbar.🐞

Swagger UI & GraphQL are supported.




Test


Coverage


Codacy


Package version

---

**Documentation**: [https://fastapi-debug-toolbar.domake.io](https://fastapi-debug-toolbar.domake.io)

---

## Installation

```sh
pip install fastapi-debug-toolbar
```

## Quickstart

Add `DebugToolbarMiddleware` middleware to your FastAPI application:

```py
from debug_toolbar.middleware import DebugToolbarMiddleware
from fastapi import FastAPI

app = FastAPI(debug=True)
app.add_middleware(DebugToolbarMiddleware)
```

## SQLAlchemy

Please make sure to use the *"Dependency Injection"* system as described in the [FastAPI docs](https://fastapi.tiangolo.com/tutorial/sql-databases/#create-a-dependency) and add the `SQLAlchemyPanel` to your panel list:

```py
app.add_middleware(
DebugToolbarMiddleware,
panels=["debug_toolbar.panels.sqlalchemy.SQLAlchemyPanel"],
)
```

## Tortoise ORM

Add the `TortoisePanel` to your panel list:

```py
app.add_middleware(
DebugToolbarMiddleware,
panels=["debug_toolbar.panels.tortoise.TortoisePanel"],
)
```