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

[FIX] upstream cached pages showing mobile for desktop pages #52

Open alanjds opened 9 years ago

alanjds commented 9 years ago

We got a client complaining about mobile pages showing up for desktop browsers. Turned up that he uses a Varnish-backed server, and django-mobile serves pages based on User-Agent if MobileDetectionMiddleware is used.

It should set the Vary: User-Agent header.

gregmuellegger commented 9 years ago

Hey, that's a very useful addition. Thanks! However in order to merge this, we would need some basic tests for this. Would you like to step up and write some tests for this? That would really make a difference. Once this PR has tests, I will merge it and release a new version containing the changes.

alanjds commented 9 years ago

Ouch... I appreciate projects with tests, but I have no experience on coding Unittests, just Doctests. I can do it, but waiting for me will take some time.

gregmuellegger commented 9 years ago

Ok, don't hesitate to ask questions if you don't get along. :)