Ticket #6494: 6494.diff

File 6494.diff, 1.0 KB (added by Thejaswi Puthraya, 17 years ago)

made changes suggested by SmileyChris

  • django/views/debug.py

     
    7070    Create a technical server error response. The last three arguments are
    7171    the values returned from sys.exc_info() and friends.
    7272    """
     73    html = get_traceback_html(request, exc_type, exc_value, tb)
     74    return HttpResponseServerError(html, mimetype='text/html')
     75
     76def get_traceback_html(request, exc_type, exc_value, tb):
     77    "Return HTML code for traceback."
    7378    template_info = None
    7479    template_does_not_exist = False
    7580    loader_debug_info = None
     
    159164        'template_does_not_exist': template_does_not_exist,
    160165        'loader_debug_info': loader_debug_info,
    161166    })
    162     return HttpResponseServerError(t.render(c), mimetype='text/html')
     167    return t.render(c)
    163168
    164169def technical_404_response(request, exception):
    165170    "Create a technical 404 error response. The exception should be the Http404."
Back to Top