Fetches IpRange instance if request IP is found in database.

        :param request: A ususal request object
        :type request: HttpRequest
        :return: IpRange object or None

def _get_ip_range(self):
        """
        Fetches IpRange instance if request IP is found in database.

        :param request: A ususal request object
        :type request: HttpRequest
        :return: IpRange object or None
        """
        ip = self._get_real_ip()
        try:
            geobase_entry = IpRange.objects.by_ip(ip)
        except IpRange.DoesNotExist:
            geobase_entry = None
        return geobase_entry