'Determine if the request came from a crawler or not.
This method is simplistic and only looks at the user agent header at the
moment, but could later be improved to be smarter about detection.'

@classmethod
def is_crawler(cls, request):

    current = cls.current()
    if (not current.enabled):
        return False
    req_user_agent = request.META.get('HTTP_USER_AGENT')
    crawler_agents = current.known_user_agents.split(',')
    if ((not req_user_agent) or (not crawler_agents)):
        return False
    if isinstance(req_user_agent, six.binary_type):
        crawler_agents = [crawler_agent.encode('iso-8859-1') for crawler_agent in crawler_agents]
    return any((req_user_agent.startswith(crawler_agent) for crawler_agent in crawler_agents))
