def install_error_handlers():
 root_urlconf_module = getattr(settings, u'ROOT_URLCONF', None)
 if (not root_urlconf_module):
  return
 try:
  root_urlconf = import_module(root_urlconf_module)
 except ImportError:
  return
 for error_status in (400, 403, 404, 500):
  handler_attr = (HANDLER_ATTR_FMT % error_status)
  if hasattr(root_urlconf, handler_attr):
   _URLCONF_ERROR_HANDLERS[handler_attr] = getattr(root_urlconf, handler_attr)
  setattr(root_urlconf, handler_attr, make_error_view(error_status))

def install_error_handlers ( ) : root_urlconf_module = getattr ( settings , u'ROOT_URLCONF' , None ) if ( not root_urlconf_module ) : return try : root_urlconf = import_module ( root_urlconf_module ) except ImportError : return for error_status in ( 400 , 403 , 404 , 500 ) : handler_attr = ( HANDLER_ATTR_FMT % error_status ) if hasattr ( root_urlconf , handler_attr ) : _URLCONF_ERROR_HANDLERS [ handler_attr ] = getattr ( root_urlconf , handler_attr ) setattr ( root_urlconf , handler_attr , make_error_view ( error_status ) )
install custom error handlers .