diff --git a/django/views/debug.py b/django/views/debug.py index e5baf91662..b08a56a524 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -255,6 +255,7 @@ TECHNICAL_500_TEMPLATE = """ hideAll(getElementsByClassName(document, 'table', 'vars')); hideAll(getElementsByClassName(document, 'ol', 'pre-context')); hideAll(getElementsByClassName(document, 'ol', 'post-context')); + hideAll(getElementsByClassName(document, 'div', 'pastebin')); } function toggle() { for (var i = 0; i < arguments.length; i++) { @@ -273,6 +274,13 @@ TECHNICAL_500_TEMPLATE = """ s.innerHTML = s.innerHTML == uarr ? darr : uarr; return false; } + function switchPastebinFriendly(link) { + s1 = "Switch to copy-and-paste view"; + s2 = "Switch back to interactive view"; + link.innerHTML = link.innerHTML == s1 ? s2 : s1; + toggle('browserTraceback', 'pastebinTraceback'); + return false; + } //--> @@ -341,47 +349,71 @@ TECHNICAL_500_TEMPLATE = """ {% endif %}

Traceback (innermost last)

- +
+
+ + + + + + +
+ +Traceback (most recent call last):
+{% for frame in frames %} + File "{{ frame.filename }}" in {{ frame.function }}
+ {% if frame.context_line %} +   {{ frame.lineno|add:"1" }}. {{ frame.context_line|escape }}
+ {% endif %} +{% endfor %}
+  {{ exception_type }} at {{ request.path }}
+  {{ exception_value|escape }}
+
+