def get_request_ip_resolver():
    """
    This is the recommended method for obtaining the specified
    CMS_REQUEST_IP_RESOLVER as it also does some basic import validation.

    Returns the resolver or raises an ImproperlyConfigured exception.
    """
    module, attribute = get_cms_setting('REQUEST_IP_RESOLVER').rsplit('.', 1)
    try:
        ip_resolver_module = importlib.import_module(module)
        ip_resolver = getattr(ip_resolver_module, attribute)
    except ImportError:
        raise ImproperlyConfigured(
            _('Unable to find the specified CMS_REQUEST_IP_RESOLVER module: '
              '"%s".') % module)
    except __HOLE__:
        raise ImproperlyConfigured(
            _('Unable to find the specified CMS_REQUEST_IP_RESOLVER function: '
              '"%s" in module "%s".') % (attribute, module, ))
    return ip_resolver
dataset/ETHPy150Open divio/django-cms/cms/utils/request_ip_resolvers.py/get_request_ip_resolver