django-mobile-views 0.1.1
Some mixins to serve mobile templates when mobile detected.
django-mobile-views is a simple app to help detect mobile browsers and serve a different template for them.
It works by inspecting the user agent.
To use, either use one of the mobile generic views, or add the MobileMixin to your class based view.
from mobile_views.generic_views import MobileTemplateView
- class HomePage(MobileTemplateView):
- template_name = 'myapp/home_page.html' mobile_template_name = 'myapp/mobile_home_page.html'
And that's it!
There is also a 'FullSiteView' provided that when accessed will set a cookie to prevent being served the mobile template. The cookie lasts until browser close.
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| django-mobile-views-0.1.1.tar.gz (md5) | Source | 2012-01-10 | 4KB | 178 | |
- Author: Aaron Madison
- Home Page: https://github.com/madisona/django-mobile-views
-
Categories
- Development Status :: 4 - Beta
- Environment :: Web Environment
- Framework :: Django
- Intended Audience :: Developers
- License :: OSI Approved :: BSD License
- Operating System :: OS Independent
- Programming Language :: Python
- Topic :: Software Development
- Topic :: Software Development :: Libraries :: Application Frameworks
- Package Index Owner: Aaron.Madison
- DOAP record: django-mobile-views-0.1.1.xml
