How to detect Browser type in Django?

AlgoMan picture AlgoMan · Apr 19, 2010 · Viewed 42.3k times · Source

How can i detect which browser type the client is using. I have a problem where i have to ask people to use different browser (Firefox) instead of IE. How can i get this information.

I know http request has this information (Header). How will i get the navigator.appName from the view.py in the Django framework ?

Answer

digitaldreamer picture digitaldreamer · Apr 19, 2010

You can extract that information from the request object like so:

request.META['HTTP_USER_AGENT']