Skip to content

Instantly share code, notes, and snippets.

@montylounge
Forked from kylef/unknown_browsers.py
Created February 7, 2010 19:57
Show Gist options
  • Select an option

  • Save montylounge/297641 to your computer and use it in GitHub Desktop.

Select an option

Save montylounge/297641 to your computer and use it in GitHub Desktop.
# This code grabs all unknown browsers in django-request on a django project.
from request.models import Request
from request.utils import browsers
requests = Request.objects.this_month().only('user_agent')
user_agents = [request.user_agent for request in requests]
unknown_agents = [agent for agent in user_agents if browsers.resolve(agent)[0] == 'Unknown']
print unknown_agents
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment