'Processing for any otherwise uncaught exceptions (those that will
generate HTTP 500 responses). Can be overridden by subclasses who want
customised 500 handling.
Be *very* careful when overriding this because the error could be
caused by anything, so assuming something like the database is always
available would be an error.'

def handle_uncaught_exception(self, request, resolver, exc_info):

    from django.conf import settings
    from django.core.mail import mail_admins
    if settings.DEBUG_PROPAGATE_EXCEPTIONS:
        raise
    if settings.DEBUG:
        from django.views import debug
        return debug.technical_500_response(request, *exc_info)
    subject = ('Error    (%s    IP):    %s' % ((((request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS) and 'internal') or 'EXTERNAL'), request.path))
    try:
        request_repr = repr(request)
    except:
        request_repr = 'Request    repr()    unavailable'
    message = ('%s\n\n%s' % (self._get_traceback(exc_info), request_repr))
    mail_admins(subject, message, fail_silently=True)
    if (resolver.urlconf_module is None):
        raise exc_info[1], None, exc_info[2]
    (callback, param_dict) = resolver.resolve500()
    return callback(request, **param_dict)
