Registry / web-framework / django-queryinspect

django-queryinspect

JSON →
library1.1.0pypypiunverified

Django Query Inspector is a middleware that logs or displays SQL queries executed during a request, including duplicate queries and query counts. Current version 1.1.0, last updated in 2019. No active development, stable for Django 2.x and earlier.

pip install django-queryinspect
INSTALL
IMPORT
SIG · DJANGO-QUERYINSPEC
D
django-queryinspect
web-frameworkpythonv1.1.0
Install
4.3s avg
Import
—
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 67.7MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 4.3s · import 0.000s · 68MB
66MB installed
● package 66MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

QueryInspectMiddleware
✓ from qinspect.middleware import QueryInspectMiddleware
✗ from queryinspect.middleware import QueryInspectMiddleware

Add the middleware to your Django settings. Visit any page and check the console or Django server output for SQL query logs.

MIDDLEWARE = [ 'queryinspect.middleware.QueryInspectMiddleware', # ... other middleware ] # Optional settings QUERYINSPECT_LOG_TRACEBACKS = False QUERYINSPECT_ABSOLUTE_LIMIT = 100 # in ms QUERYINSPECT_LOG_QUERIES = True QUERYINSPECT_LOG_DUPLICATE_QUERIES = True
Debug
Known issues
gotchaThe middleware only works with Django's DEBUG=True because it uses django.db.connection.queries, which is only populated when DEBUG is True.
fix
Set DEBUG=True in your settings or use a different tool for production profiling.
affects: all
deprecatedThis library has not been updated since 2019 and does not officially support Django 3.0+ or Python 3.8+. It may still work with modern Django but is not tested.
fix
Consider using django-debug-toolbar or django-silk for active development and support.
affects: Django >=3.0, Python >=3.8
gotchaIf you use a custom database backend that does not set django.db.connection.queries, the middleware will not capture any queries.
fix
Ensure your database backend populates connection.queries (default Django backends do).
affects: all
Upgrade
Version history
1.1.0latest on PyPI · released Sep 10, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
3
Anthropic
1
Resources
django-queryinspect — pip install django-queryinspect · libregistry