django-debug-toolbar/django-debug-toolbar — Issue #236: RequesrContext vars misisng when using render shortcut
Author: matteius
Created: 2011-11-29 16:06:41+00:00
State: open

This seems to be a similar issue that was experienced in this ticket (https://github.com/django-debug-toolbar/django-debug-toolbar/issues/159). However, I experienced the issue running off the latest point release, once I found the ticket I thought to update to the latest git checkout of master: the issue remains. The issue is that when using a shortcut derived from render, the RequestContext dictionary shows up in the template "Toggle Context" as simply {}.

If I convert from using the render shortcut to using:
#return branded_render(request, template_name, data)
# Specify template, generate context, and return response
template = loader.get_template(template_name)
context = RequestContext(request, data)
return HttpResponse(template.render(context))

Now when using this approach I get a the full context (what is epected and why I post this bug):
{'giftcard': ,
'redirect_code': u'd3c4004f0f8849a1823e5c6d69defdfe'}

So I conclude that the bug is missing context when using the render shortcut, omits what is in the RequestContext dict, but still includes context from the context_processors. I would like to see this fixed since our project isn't abandoning the shortcut anytime soon. this bug was experienced in the latest pt release, the latest zip, as well as the git pull of the latest trunk. Verified that the running code was active for only each distribution tested.