Skip to content

Merge changes #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion debug_toolbar/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def process_response(self, request, response):
response.content = replace_insensitive(
smart_unicode(response.content),
self.tag,
smart_unicode(toolbar.render_toolbar() + self.tag))
smart_unicode(toolbar.render_toolbar(request) + self.tag))
if response.get('Content-Length', None):
response['Content-Length'] = len(response.content)
del self.__class__.debug_toolbars[ident]
Expand Down
5 changes: 3 additions & 2 deletions debug_toolbar/toolbar/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module
from django.utils.safestring import mark_safe
from django.template.context import RequestContext


class DebugToolbar(object):
Expand Down Expand Up @@ -52,7 +53,7 @@ def load_panels(self):

self._panels[panel_class] = panel_instance

def render_toolbar(self):
def render_toolbar(self, request):
"""
Renders the overall Toolbar with panels inside.
"""
Expand All @@ -61,7 +62,7 @@ def render_toolbar(self):
'panels': self.panels,
})

return render_to_string('debug_toolbar/base.html', context)
return render_to_string('debug_toolbar/base.html', RequestContext(request, context))


panel_classes = []
Expand Down