Lightweight performance devbar for Django
Project description
django-devbar
Lightweight performance devbar for Django. Shows DB query count, query duration, and response time.
Installation
pip install django-devbar
Add to your middleware as early as possible, but after any middleware that encodes the response (e.g., GZipMiddleware):
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django_devbar.DevBarMiddleware",
# ...
]
Configuration
# Position: bottom-right, bottom-left, top-right, top-left (default: bottom-right)
DEVBAR_POSITION = "top-left"
# Show HTML overlay (default: DEBUG)
DEVBAR_SHOW_BAR = True
# Add X-DevBar-* response headers (default: False)
DEVBAR_SHOW_HEADERS = True
Response Headers
When DEVBAR_SHOW_HEADERS = True, performance metrics are added as HTTP response headers. This is useful for:
- API endpoints where the HTML overlay can't be displayed
- Automated testing to assert performance thresholds (e.g., fail CI if query count exceeds a limit)
- Monitoring tools that can capture and aggregate header values
Headers included:
| Header | Description |
|---|---|
X-DevBar-Query-Count |
Number of database queries executed |
X-DevBar-Query-Duration |
Total time spent in database queries (ms) |
X-DevBar-Response-Time |
Total request-response cycle time (ms) |
X-DevBar-Has-Duplicates |
Present (value 1) if duplicate queries detected |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_devbar-0.1.0.tar.gz.
File metadata
- Download URL: django_devbar-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
050344e449f0604ca88292c0eeaafa5c6260969628b9758dfc8480e8c215416b
|
|
| MD5 |
bbe2ae3aa7fb0067f2e1db489a4be689
|
|
| BLAKE2b-256 |
36808faff0b56f69735397f3d2f73b897ae2b7f2f03a820ba041af9fd15eb2ee
|
File details
Details for the file django_devbar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_devbar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
888380a7f14820b4d667b1232bbda06e9fd4e9879f5f2390bfde670ea01835ed
|
|
| MD5 |
386c2bcf3f89aabd63c9fd679ee49401
|
|
| BLAKE2b-256 |
237a09b8d9974491e47ea2837118a9d45269abeb68fc7a8ee49a2d0ad933ed49
|