class ExceptionMiddleware(object):

    def process_exception(self, request, exception):
        if isinstance(exception, Http404):
            pass
Making the stack levels in Django HTML email reports collapsable