Ticket #2437: django-dpaste-prettified.diff
File django-dpaste-prettified.diff, 3.4 KB (added by , 17 years ago) |
---|
-
django/views/debug.py
131 131 if start is not None and end is not None: 132 132 unicode_str = exc_value.args[1] 133 133 unicode_hint = smart_unicode(unicode_str[max(start-5, 0):min(end+5, len(unicode_str))], 'ascii', errors='replace') 134 134 from django import get_version 135 135 t = Template(TECHNICAL_500_TEMPLATE, name='Technical 500 template') 136 136 c = Context({ 137 137 'exception_type': exc_type.__name__, … … 144 144 'settings': get_safe_settings(), 145 145 'sys_executable' : sys.executable, 146 146 'sys_version_info' : '%d.%d.%d' % sys.version_info[0:3], 147 'django_version_info' : get_version(), 147 148 'template_info': template_info, 148 149 'template_does_not_exist': template_does_not_exist, 149 150 'loader_debug_info': loader_debug_info, … … 275 276 #requestinfo h3 { margin-bottom:-1em; } 276 277 .error { background: #ffc; } 277 278 .specific { color:#cc3300; font-weight:bold; } 279 h2 span.commands { font-size:.7em;} 280 span.commands a:link {color:#5E5694;} 278 281 </style> 279 282 <script type="text/javascript"> 280 283 //<!-- … … 409 412 </div> 410 413 {% endif %} 411 414 <div id="traceback"> 412 <h2>Traceback <span>(innermost last)</span></h2> 413 <div class="commands"><a href="#" onclick="return switchPastebinFriendly(this);">Switch to copy-and-paste view</a></div> 414 <br/> 415 <h2>Traceback <span class="commands"><a href="#" onclick="return switchPastebinFriendly(this);">Switch to copy-and-paste view</a></span></h2> 416 415 417 {% autoescape off %} 416 418 <div id="browserTraceback"> 417 419 <ul class="traceback"> … … 456 458 {% endfor %} 457 459 </ul> 458 460 </div> 461 {% endautoescape %} 459 462 <div id="pastebinTraceback" class="pastebin"> 460 <table> 461 <tbody> 462 <tr> 463 <td> 464 <code> 465 Traceback (most recent call last):<br/> 463 <form action="http://dpaste.com/" name="pasteform" id="pasteform" method="post"> 464 <input type="hidden" name="language" value="PythonConsole" /> 465 <input type="hidden" name="title" value="{{ exception_type|escape }} at {{ request.path|escape }}" /> 466 <input type="hidden" name="source" value="Django Dpaste Agent" /> 467 <input type="hidden" name="poster" value="Django" /> 468 <textarea name="content" id="traceback_area" cols="140" rows="25"> 469 Environment: 470 Django Version: {{ django_version_info }} 471 Python Version: {{ sys_version_info }} 472 Installed Applications: 473 {{ settings.INSTALLED_APPS|pprint }} 474 Installed Middleware: 475 {{ settings.MIDDLEWARE_CLASSES|pprint }} 476 477 Traceback: 466 478 {% for frame in frames %} 467 File "{{ frame.filename }}" in {{ frame.function }}<br/> 468 {% if frame.context_line %} 469 {{ frame.lineno }}. {{ frame.context_line|escape }}<br/> 470 {% endif %} 471 {% endfor %}<br/> 472 {{ exception_type }} at {{ request.path|escape }}<br/> 473 {{ exception_value|escape }}</code> 474 </td> 475 </tr> 476 </tbody> 477 </table> 479 File "{{ frame.filename|escape }}" in {{ frame.function|escape }} 480 {% if frame.context_line %}{{ frame.lineno }}. {{ frame.context_line|escape }}{% endif %} 481 {% endfor %} 482 483 {{ exception_type|escape }} at {{ request.path|escape }} 484 {{ exception_value|escape }} 485 </textarea> 486 <br><input type="submit" value="Send to DPaste"> 487 </form> 478 488 </div> 479 {% endautoescape %}480 489 </div> 481 490 482 491 <div id="requestinfo">