def _render_exception(self, exception): frames = extract_tb(exception.__traceback__) frame_html = [] for frame in frames: frame_html.append(TRACEBACK_LINE_HTML.format(frame)) return TRACEBACK_WRAPPER_INNER_HTML.format( exc_name=exception.__class__.__name__, exc_value=exception, frame_html=''.join(frame_html))
def _render_traceback_html(self, exception, request): exc_type, exc_value, tb = sys.exc_info() frames = extract_tb(tb) frame_html = [] for frame in frames: frame_html.append(TRACEBACK_LINE_HTML.format(frame)) return TRACEBACK_WRAPPER_HTML.format(style=TRACEBACK_STYLE, exc_name=exc_type.__name__, exc_value=exc_value, frame_html=''.join(frame_html), uri=request.url)