django-debug-toolbar/django-debug-toolbar — Issue #240: rendering templates while TemplateDebugPanel.content() executes causes infinite loop
Author: gdehaan
Created: 2011-12-19 17:32:44+00:00
State: open

I am using the debug toolbar in conjunction with django-activity-stream, which in case of USE_I18N = True implements Action.__unicode__() with a render_to_string(template). The __unicode__() method is called while rendering the template context of my templates in TemplateDebugPanel.content(), and thus add another entry to the templates array, which will then be rendered as one of the used templates, etc, etc, infinite loop.

I have 'fixed' this by patching TemplateDebugPanel.content() by disconnecting from the template_rendered signal (ie template_rendered.disconnect(self._store_template_info) on the first line of that method).

Best regards,
Gijsbert