def make_error_view(error_status):
 def view(request, *args, **kwargs):
  handler_attr = (HANDLER_ATTR_FMT % error_status)
  for handler_spec in settings.SHUUP_ERROR_PAGE_HANDLERS_SPEC:
   handler = load(handler_spec)()
   if handler.can_handle_error(request, error_status):
    return handler.handle_error(request, error_status)
  fallback_handler = _URLCONF_ERROR_HANDLERS.get(handler_attr)
  if (fallback_handler and callable(fallback_handler)):
   return fallback_handler(request)
  else:
   return HttpResponse(status=error_status)
 return view

def make_error_view ( error_status ) : def view ( request , * args , ** kwargs ) : handler_attr = ( HANDLER_ATTR_FMT % error_status ) for handler_spec in settings . SHUUP_ERROR_PAGE_HANDLERS_SPEC : handler = load ( handler_spec ) ( ) if handler . can_handle_error ( request , error_status ) : return handler . handle_error ( request , error_status ) fallback_handler = _URLCONF_ERROR_HANDLERS . get ( handler_attr ) if ( fallback_handler and callable ( fallback_handler ) ) : return fallback_handler ( request ) else : return HttpResponse ( status = error_status ) return view
a factory of error views which tries to find a compatible error handler if not handler can do the job .