Skip to main content

django-tracepanel

CI PyPI Python Django

See what your Django app is really doing. Tracepanel records each request, Celery task and management command of your Django app with its SQL queries, cache calls, Redis commands, outgoing HTTP calls, templates, signals, emails, logs and errors. It points out N+1 queries and calls, duplicates, slow SQL and slow HTTP calls, and long transactions, and names the line of code to fix.

Swagger UI with the panel docked under it: the requests made with Try it out, and the call tree of one with two N+1 queries

This package has no code of its own. It installs tracepanel with Django support, the same as pip install "tracepanel[django]".

pip install django-tracepanel

Setup

Add the app to your settings. It is on whenever DEBUG = True.

# settings.py
INSTALLED_APPS += ["tracepanel.django"]

To leave the settings as they are, start the server through tracepanel run instead. It turns Tracepanel on even with DEBUG = False.

tracepanel run python manage.py runserver

Open any page and click the badge in the corner to open the panel. The console is at /__tracepanel__/.

What it looks like

The panel also lists the requests your pages and tools make with fetch(), here Swagger UI's Try it out. Each issue comes with its fix in Django's terms, such as the select_related() that removes an N+1:

The Issues tab of an API request made from Swagger UI: an N+1 with where it comes from and the fix

The console shows every endpoint over time, with the slowest and the failing ones:

The console's HTTP page: requests and latency over time, the slowest and the failing endpoints

Work without a page, such as Celery tasks, has its own pages:

The console's Tasks page: runs and latency over time, the slowest and the failing tasks

Supports

Django 5.2, 6.0 and 6.1 on Python 3.11 to 3.15, each pair tested in CI. Django 6.x needs Python 3.12 or newer, and Python 3.15 runs with Django 6.1.

  • Django: requests and views, sync and async, under runserver or any WSGI or ASGI server. Templates, Django's and Jinja2, with their context. The cache, signals, email, logins and logouts, file storages and collectstatic, management commands, migrate and its operations, and the App tab's settings, system checks and unapplied migrations.
  • Databases: the ORM's queries and atomic() blocks on any database, tested on SQLite, PostgreSQL and SQL Server (mssql-django). Queries sent through a driver directly too: sqlite3, aiosqlite, psycopg, psycopg2, asyncpg, PyMySQL, mysqlclient, MySQL Connector, aiomysql, asyncmy, python-oracledb, pyodbc and pymssql. EXPLAIN on PostgreSQL, MySQL, SQLite and SQL Server. SQLAlchemy and MongoDB (PyMongo) as well.
  • APIs: Django REST framework, Django Ninja, Graphene, Strawberry and htmx.
  • Background work: Celery, Dramatiq, RQ, Huey, django-q2, Taskiq, Django Tasks (Django 6.0, or the django-tasks backport on 5.2) and Channels, its WebSocket consumers and workers.
  • Clients: requests and anything else on urllib3, httpx, aiohttp, Redis and Valkey, AWS through boto3 and aiobotocore, and the OpenAI and Anthropic SDKs. Spans from OpenTelemetry instrumentations join the trace.
  • Profiling: where a request's or a task's time goes, from the panel. Its memory too, when asked for.
  • Tests: pytest --tracepanel fails a test that makes an N+1 or duplicate queries, with pytest-django and pytest-xdist.

Documentation

The Django guide is at tracepanel.dev/docs/django: what Tracepanel records in Django, its settings, workers and commands. The panel, the console and the issues are the same in every framework, under tracepanel.dev/docs.

License

Licensed under the MIT License.

Metadata

Release files for django-tracepanel 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-tracepanel 0.5.0
File Size Uploaded Provenance Actions
django_tracepanel-0.5.0.tar.gz 4.2 kB Without provenance Details for django_tracepanel-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-tracepanel 0.5.0
File Interpreter ABI Platform Actions
django_tracepanel-0.5.0-py3-none-any.whl Python 3 none any Details for django_tracepanel-0.5.0-py3-none-any.whl

Total release size: 8.2 kB

Release files / django_tracepanel-0.5.0.tar.gz

Download URL django_tracepanel-0.5.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7de2a008562242ffd69c43afe9c79a6ec3d1b72cc1d9776957ac0f381aaa7e68
BLAKE2b-256 checksum
How to use checksums
dd585b70cef25484840e1fccf022e5339eb010c418e7d0f2e61a5a74aad6d720
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / django_tracepanel-0.5.0-py3-none-any.whl

Download URL django_tracepanel-0.5.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b139d8f60cf750c4fe861cedc1ade0212ebeeceffd74660dcf615e9d7a82fbe
BLAKE2b-256 checksum
How to use checksums
d3865e242435cb46f29514b885cf78f04325d54e74d486f08fa1dc7ae5a1d5bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for django-tracepanel 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page