Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Traces slow Django ORM queries to the views, serializers, or templates issuing them, then routes fixes to the matching optimization skill.
Use this skill ↓41% 68%+27 ptsof test cases passed
Passed 15 of 22 test cases with the skill, and 9 of 22 without it.
3 of 3 safety checks passed
Not used yet
Use APM when the slow path happens in production and needs real traffic context.
Collect:
Treat APM output as a lead. Reproduce before editing unless the fix is an emergency mitigation.
Use Django Debug Toolbar for local server-rendered pages. It shows query count, SQL, duplicate queries, and timing.
Do not rely on it alone for API views, streaming responses, background jobs, or production timings. For those, wrap the code path with targeted logging.
For a local shell, test, or temporary diagnostic branch:
from django.db import connection, reset_queries
from django.test.utils import CaptureQueriesContext
reset_queries()
with CaptureQueriesContext(connection) as ctx:
response = client.get("/orders/?status=open")
print(len(ctx))
for query in ctx.captured_queries[:20]:
print(query["time"], query["sql"])
Use CaptureQueriesContext in tests only for narrow regression coverage. Avoid broad query-count assertions that break on harmless framework changes.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.