From 13aa1970d44ab282fb2f1da763e558c84e0ca906 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 2 Dec 2007 00:00:36 +0000 Subject: [PATCH] Fixed #2437, #6091 -- Added "paste to dpaste" button to debug page. Thanks, Christian Metts, Erik Karulf, Simon Greenhill, dummy@habmalnefrage.de. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6820 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- AUTHORS | 1 + django/views/debug.py | 73 +++++++++++++++++++++++++++++-------------- 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/AUTHORS b/AUTHORS index 8191865997..5965b728a8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -172,6 +172,7 @@ answer newbie questions, and generally made Django that much better: junzhang.jn@gmail.com Antti Kaihola Nagy Károly + Erik Karulf Ben Dean Kawamura Ian G. Kelly Thomas Kerpe diff --git a/django/views/debug.py b/django/views/debug.py index 3358d2f08e..fba43912bb 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -131,7 +131,7 @@ def technical_500_response(request, exc_type, exc_value, tb): if start is not None and end is not None: unicode_str = exc_value.args[1] unicode_hint = smart_unicode(unicode_str[max(start-5, 0):min(end+5, len(unicode_str))], 'ascii', errors='replace') - + from django import get_version t = Template(TECHNICAL_500_TEMPLATE, name='Technical 500 template') c = Context({ 'exception_type': exc_type.__name__, @@ -144,6 +144,7 @@ def technical_500_response(request, exc_type, exc_value, tb): 'settings': get_safe_settings(), 'sys_executable' : sys.executable, 'sys_version_info' : '%d.%d.%d' % sys.version_info[0:3], + 'django_version_info' : get_version(), 'template_info': template_info, 'template_does_not_exist': template_does_not_exist, 'loader_debug_info': loader_debug_info, @@ -275,6 +276,8 @@ TECHNICAL_500_TEMPLATE = """ #requestinfo h3 { margin-bottom:-1em; } .error { background: #ffc; } .specific { color:#cc3300; font-weight:bold; } + h2 span.commands { font-size:.7em;} + span.commands a:link {color:#5E5694;}