code: def _get_ip_range(self):
          
          ip = self._get_real_ip()
          try:
              geobase_entry = IpRange.objects.by_ip(ip)
          except IpRange.DoesNotExist:
              geobase_entry = None
          return geobase_entry
docs: Fetches IpRange instance if request IP is found in database.
  
          :param request: A ususal request object
          :type request: HttpRequest
          :return: IpRange object or None