gregmuellegger / django-mobile

Detect mobile browsers and serve different template flavours to them.
http://pypi.python.org/pypi/django-mobile
BSD 3-Clause "New" or "Revised" License
560 stars 170 forks source link

Adding smart watch flavour ? #65

Closed sunjoomoon closed 8 years ago

sunjoomoon commented 8 years ago

I am trying out things and wondered how I can add another flavour, from the doc it seems it could be implemented rather easy. Any clue as to how I could do this?

gregmuellegger commented 8 years ago

What have you tried so far?

I think it's just adding another name to the FLAVOURS setting:

# in settings.py
FLAVOURS = ('full', 'mobile', 'tablet')
sunjoomoon commented 8 years ago

Hmm, just like that? I am all lost.

prokaktus commented 8 years ago

@sunjoomoon look at the example for tablet detection https://github.com/gregmuellegger/django-mobile/blob/master/examples/middleware.py

You should investigate how to detect smart watch browsers (by user-agent or another header), write custom rule and add new flavour to FLAVOURS setting.

sunjoomoon commented 8 years ago

Thanks, sorry for long absence. Yes, now it makes sense.