Ticket #2437: django_dpaste-2.diff

File django_dpaste-2.diff, 3.1 KB (added by Erik Karulf, 13 years ago)

Updated to include some extra environment information

  • django/views/debug.py

     
    131131        if start is not None and end is not None:
    132132            unicode_str = exc_value.args[1]
    133133            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
    135135    t = Template(TECHNICAL_500_TEMPLATE, name='Technical 500 template')
    136136    c = Context({
    137137        'exception_type': exc_type.__name__,
     
    144144        'settings': get_safe_settings(),
    145145        'sys_executable' : sys.executable,
    146146        'sys_version_info' : '%d.%d.%d' % sys.version_info[0:3],
     147        'django_version_info' : get_version(),
    147148        'template_info': template_info,
    148149        'template_does_not_exist': template_does_not_exist,
    149150        'loader_debug_info': loader_debug_info,
     
    329330      toggle('browserTraceback', 'pastebinTraceback');
    330331      return false;
    331332    }
     333    function submitDPaste() {
     334      document.pasteform.submit();
     335    }
    332336    //-->
    333337  </script>
    334338</head>
     
    409413</div>
    410414{% endif %}
    411415<div id="traceback">
    412   <h2>Traceback <span>(innermost last)</span></h2>
     416  <h2>Traceback</h2>
    413417  <div class="commands"><a href="#" onclick="return switchPastebinFriendly(this);">Switch to copy-and-paste view</a></div>
    414418  <br/>
    415419  {% autoescape off %}
     
    462466        <tr>
    463467          <td>
    464468            <code>
    465 Traceback (most recent call last):<br/>
     469Environment:<br/>
     470Django Version: {{ django_version_info }}<br/>
     471Installed Applications: <br/>
     472{{ settings.INSTALLED_APPS|pprint|escape }}
     473Installed Middleware: <br/>
     474{{ settings.MIDDLEWARE_CLASSES|pprint|escape }}
     475<br/><br/>
     476Traceback:<br/>
    466477{% for frame in frames %}
    467478  File "{{ frame.filename }}" in {{ frame.function }}<br/>
    468479  {% if frame.context_line %}
     
    477488    </table>
    478489  </div>
    479490  {% endautoescape %}
     491<a href="#" onclick="return submitDPaste();">Submit to DPaste</a><sup>?</sup><br/>
     492<form action="http://dpaste.com/" name="pasteform" id="pasteform" method="post">
     493<input type="hidden" name="language" value="PythonConsole" />
     494<input type="hidden" name="title" value="{{ exception_type|escape }} at {{ request.path|escape }}" />
     495<input type="hidden" name="source" value="Django Dpaste Agent" />
     496<input type="hidden" name="poster" value="Django" />
     497<textarea name="content" id="traceback_area" cols="140" rows="30" style="display: none;">
     498{% spaceless %}
     499Environment:
     500Django Version: {{ django_version_info }}
     501Python Version: {{ sys_version_info }}
     502Installed Applications:
     503{{ settings.INSTALLED_APPS|pprint }}
     504Installed Middleware:
     505{{ settings.MIDDLEWARE_CLASSES|pprint }}
     506
     507Traceback:
     508{% for frame in frames %}
     509File "{{ frame.filename|escape }}" in {{ frame.function|escape }}
     510{% if frame.context_line %}{{ frame.lineno }}. {{ frame.context_line|escape }}{% endif %}
     511{% endfor %}
     512{{ exception_type|escape }} at {{ request.path|escape }}
     513{{ exception_value|escape }}
     514{% endspaceless %}
     515</textarea>
     516</form>
    480517</div>
    481518
    482519<div id="requestinfo">
Back to Top