django-queryinspect
Django Query Inspector
Decision gist · record as of 2026-08-14
No. The package is abandoned (last commit 2020-02-27, no releases since 2019-09-10) and will not receive security updates or Django compatibility fixes. For modern Django projects, consider actively maintained alternatives like django-debug-toolbar or django-silk, which offer similar query inspection with ongoing support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 1.11 or later and DEBUG = True enabled; SQL query logging does not work without DEBUG mode.
- Low install friction with a single runtime dependency on Django.
- However, the package is abandoned—last release was 2019-09-10 and last commit 2020-02-27.
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and proprietary projects.
last release 2019-09-10 (2530 days) · last repo commit 2020-02-27 · 568 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 73,619 downloads/mo, #14,961 on PyPI
Alternatives
Verify before relying
pip install django-queryinspect
# In Django settings.py:
MIDDLEWARE += ('qinspect.middleware.QueryInspectMiddleware',)
QUERY_INSPECT_ENABLED = True
DEBUG = True
# Configure logging to see output
LOGGING = {
'loggers': {
'qinspect': {'handlers': ['console'], 'level': 'DEBUG'},
},
}- Compatibility with modern Django versions (3.2+, 4.x, 5.x) given the package's abandonment since 2020.
- Whether the heuristic for detecting duplicate queries (ignoring integer values) remains effective with current Django ORM patterns.
- Performance impact on high-traffic applications when query logging and traceback collection are enabled.
What it is and what it does
Django Query Inspector is middleware that intercepts and analyzes SQL queries executed during each web request. It logs aggregate statistics—total query count, execution time, and duplicate detection—and optionally adds these metrics to HTTP response headers for easier debugging without server log inspection.
The package detects duplicate queries by normalizing SQL statements to ignore integer values, targeting the common Django pattern where N+1 queries occur due to missing prefetch_related or select_related calls. It can also include Python tracebacks showing where each duplicate query originated, helping developers identify the source code responsible. Configuration options allow fine-tuning of what gets logged, thresholds for query time alerts, and filtering of tracebacks to project-specific paths.
Use it for
- Identify N+1 query problems during development by spotting repeated SQL patterns in request logs.
- Monitor query performance during testing to catch regressions in SQL execution time across requests.
- Debug slow requests by examining query counts and timing in response headers without parsing server logs.
- Locate inefficient serialization or view logic by correlating duplicate query tracebacks to application code.
- Profile Django views in development to understand SQL behavior before optimization.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No.
The package is abandoned (last commit 2020-02-27, no releases since 2019-09-10) and will not receive security updates or Django compatibility fixes. For modern Django projects, consider actively maintained alternatives like django-debug-toolbar or django-silk, which offer similar query inspection with ongoing support.
Install
django-queryinspect on PyPI
Before you install
Low install friction with a single runtime dependency on Django. However, the package is abandoned—last release was 2019-09-10 and last commit 2020-02-27. No active maintenance means security issues or Django compatibility problems will not be addressed.
Requires Django 1.11 or later and DEBUG = True enabled; SQL query logging does not work without DEBUG mode.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and proprietary projects.
Quickstart
pip install django-queryinspect
# In Django settings.py:
MIDDLEWARE += ('qinspect.middleware.QueryInspectMiddleware',)
QUERY_INSPECT_ENABLED = True
DEBUG = True
# Configure logging to see output
LOGGING = {
'loggers': {
'qinspect': {'handlers': ['console'], 'level': 'DEBUG'},
},
}
Verify before relying
- Compatibility with modern Django versions (3.2+, 4.x, 5.x) given the package's abandonment since 2020.
- Whether the heuristic for detecting duplicate queries (ignoring integer values) remains effective with current Django ORM patterns.
- Performance impact on high-traffic applications when query logging and traceback collection are enabled.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageDjango |
| Maintenance | Abandoned 2,530 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 73,619 / month, #14,961 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules |
Evidence: django_queryinspect-1.1.0-py2-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django sql query logging”
- django-queryinspectDjango middleware that logs and reports SQL query statistics for each…
- google-cloud-sqlcommenterAutomatically injects metadata comments into SQL queries executed…
- django-querycountDjango middleware that logs the number of database queries executed…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also django-querycount · requests-tracker · django-sql-explorer · django-silk · django-zeal · django-cprofile-middleware · sqltap · django-cid · django-pgactivity · django-perf-rec