Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 days ago
JSON representation
A debug toolbar for FastAPI.
- Host: GitHub
- URL: https://github.com/mongkok/fastapi-debug-toolbar
- Owner: mongkok
- License: bsd-3-clause
- Created: 2021-07-21T19:11:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-11T09:38:27.000Z (6 months ago)
- Last Synced: 2024-09-19T16:35:07.886Z (about 2 months ago)
- Topics: ariadne, debug, fastapi, graphene, graphql, profiling, pyinstrument, sqlalchemy, swagger, tortoise-orm
- Language: Python
- Homepage: https://fastapi-debug-toolbar.domake.io
- Size: 7.08 MB
- Stars: 134
- Watchers: 4
- Forks: 14
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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
🐞A debug toolbar for FastAPI based on the original django-debug-toolbar.🐞
Swagger UI & GraphQL are supported.
---
**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 FastAPIapp = 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"],
)
```