def exception(request, traceback_name):
    traceback_path = os.path.join(settings.EXCEPTIONS_DIR, traceback_name)
with open(traceback_path, 'r') as f:
    response = HttpResponse(f.read())
return response
Making the stack levels in Django HTML email reports collapsable