jazzband / django-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
https://django-debug-toolbar.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
7.97k stars 1.03k forks source link

DDT showing incorrect template for source of SQL Query #1851

Closed Altair2169 closed 5 months ago

Altair2169 commented 8 months ago

I have a template hierarchy which goes like this

admin_base.html

admin_invoices.html

{% extends 'admin_base.html' %}
<insert some random loop which loops through the queryset>

admin_pending_invoices.html

{% extends 'admin_invoices.html' %}

and I am profiling the view which renders pending_invoices template, the issue I am facing is that DDT is pointing to a line in admin_base as the source for the SQL query whereas it should point to admin_invoices as the source for the query.

Not sure how to debug this but I have made sure that the admin_base template is not using that particular query anywhere at all.

Possible dupe of #902

EDIT:

DDT: 4.2.0 Django: 4.0.10

tim-schilling commented 8 months ago

Can you create a reproducible example for us?

matthiask commented 6 months ago

So I'm not sure if we're at fault here or if there's something going on in Django itself, since we do not actually track template locations ourselves (or at least we haven't in the past), we're just showing information Django collects itself. Or is there any evidence that it's actually django-debug-toolbar doing something strange? If not I think we should close this.

tim-schilling commented 5 months ago

Closing due to lack of response