Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A patch that make django-debug-toolbar work in Python 2.5
diff --git a/debug_toolbar/panels/ b/debug_toolbar/panels/
index 18fffdc..a0bfce8 100644
--- a/debug_toolbar/panels/
+++ b/debug_toolbar/panels/
@@ -193,8 +193,14 @@ class SQLDebugPanel(DebugPanel):
stacktrace = []
for frame in query['stacktrace']:
params = map(escape, frame[0].rsplit('/', 1) + list(frame[1:]))
+ params_dict = dict((unicode(idx), v) for idx, v in enumerate(params))
- stacktrace.append(u'<span class="path">{0}/</span><span class="file">{1}</span> in <span class="func">{3}</span>(<span class="lineno">{2}</span>)\n <span class="code">{4}</span>'.format(*params))
+ stacktrace.append(u'<span class="path">%(0)s/</span>'
+ u'<span class="file">%(1)s</span>'
+ u' in <span class="func">%(3)s</span>'
+ u'(<span class="lineno">%(2)s</span>)\n'
+ u' <span class="code">%(4)s</span>'
+ % params_dict)
except IndexError:
# This frame doesn't have the expected format, so skip it and move on to the next one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment