django-tracepanel: debug and tracing panel for Django apps

Hi everyone,

I’ve been working with Django for about 15 years. For debugging, I’ve always
used django-debug-toolbar and Celery Flower. They are good tools, but now
most of my work involves APIs (DRF, Ninja) and Celery tasks. Toolbar works
best with HTML pages, and tasks are out of its scope. Flower shows task
status, but not what happens inside: SQL queries, HTTP calls, etc.

So I made django-tracepanel.

demo

What it does:

  • shows every request, task and management command: SQL, cache, Redis,
    HTTP calls, templates, logs
  • works with API calls from Swagger UI or frontend, not only HTML pages
  • task is linked to the request which started it
  • finds N+1, duplicate and slow queries, shows EXPLAIN and the line in
    your code
  • profiler (time and memory)
  • pytest --tracepanel fails tests with N+1 queries

Supports:

  • Django 5.2, 6.0, 6.1, sync and async views
  • PostgreSQL, MySQL, SQLite, SQL Server, Oracle
  • DRF, Django Ninja, Graphene, Strawberry, htmx
  • Celery, Dramatiq, RQ, Huey, django-q2, Taskiq, Django Tasks, Channels

Full list (MongoDB, SQLAlchemy, Redis, HTTP clients, OpenAI and more) is in
the README.

Install:

pip install django-tracepanel
INSTALLED_APPS += ["tracepanel.django"]

It is on when DEBUG = True. Everything is stored locally, in a SQLite
file in .tracepanel/ in your project.

GitHub, docs are linked from the README.

It’s still an early version, so any feedback is welcome.

Thanks!

1 Like