Open kushagra219 opened 4 years ago
I have the same issue here. For information my configuration is: Python 3.7.9 Django 3.1.1 Debug Toolbar 3.1.1 Note that all other panels work fine, and this panel is the only third party I have
From the documentation, debug-toolbar-template-timings doesn't work with Django 2.0 and above.
Since django-debug-toolbar 2.0, the process_response method is deprecated. That's why the stats for template timings panel it not collected.
I can fix it by creating a new file called debug_toolbar_template_timings.py
The content is as below:
from template_timings_panel.panels.TemplateTimings import TemplateTimings
class TemplateTimingsFixed(TemplateTimings):
def process_request(self, request):
response = super().process_request(request)
self.process_response(request, response)
return response
Finally, change you django settings,
from
'template_timings_panel.panels.TemplateTimings.TemplateTimings',
to
'debug_toolbar_template_timings.TemplateTimingsFixed',
It will work as expected.
This is my settings.py part for the django-debug-toolbar and django-debug-toolbar-template-timings, but all the sections are displaying something in toolbar except template-timings which was really required as one of my templates is taking too much time to load and I can't figure out why! how can I rectify this issue?