aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels/template.py
diff options
context:
space:
mode:
authorSimon Willison2008-09-20 20:30:45 +0100
committerSimon Willison2008-09-20 20:30:45 +0100
commit8e124b0a129ab351ec6cae30d8358709d4c1430b (patch)
tree9753fe15ff8b044872c88f2362d43866bee9bec8 /debug_toolbar/panels/template.py
parentaf4f7a99dc346bb6b844564370fd6d479d6c36e7 (diff)
downloaddjango-debug-toolbar-8e124b0a129ab351ec6cae30d8358709d4c1430b.tar.bz2
Use pformat for template contexts, which makes it more readable
Diffstat (limited to 'debug_toolbar/panels/template.py')
-rw-r--r--debug_toolbar/panels/template.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py
index bda6630..e08f220 100644
--- a/debug_toolbar/panels/template.py
+++ b/debug_toolbar/panels/template.py
@@ -5,6 +5,8 @@ from django.template.loader import render_to_string
from django.test.signals import template_rendered
from debug_toolbar.panels import DebugPanel
+from pprint import pformat
+
# Code taken and adapted from Simon Willison and Django Snippets:
# http://www.djangosnippets.org/snippets/766/
@@ -60,7 +62,7 @@ class TemplateDebugPanel(DebugPanel):
info['template'] = t
# Clean up context for better readability
c = d.get('context', None)
- info['context'] = '\n'.join([_d.__repr__() for _d in c.dicts])
+ info['context'] = '\n'.join([pformat(_d) for _d in c.dicts])
template_context.append(info)
context = {
'templates': template_context,