Saturday, 8 June 2013

How to detect iPad using django-mobile

How to detect iPad using django-mobile

I just gave django-moble a try.
I really like the concept and helps my project to detect mobile device. However, I am trying to find when the request is made by iPad browser. I have added the following to the Settings.py FLAVOURS = ('full', 'mobile','ipad')
But it is not working. Can anybody kindly gave me how I can proceed from here? What else do I need to do?
The following is my view.
if get_flavour()=='full':
  t = loader.get_template('index.html')
elif get_flavour()=='ipad':
  t = loader.get_template('ipad.html')
else:
  t = loader.get_template('mobile.html')
Thank you for your time in advance.

No comments:

Post a Comment