Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Simple middleware and helper function to help handle request from mobile devices.

Project Description
Mobility Helpers

Version : 0.2
Author : Thomas Weholt <>
License : Modified BSD
Status : Beta - Experimental.

Mobility Helpers are a small reusable django app making it easier to target mobile platforms/devices. It comes as a piece of middleware
and a helper function to render a view.

In short using a special function to render your views will detect requests from mobile devices and look for a special template for that devices. Normal clients
will get a normal template. So if you access a page with your tablet the app will use to render the view instead of templatename.html.

* pip install django-mobilityhelpers
* add 'mobilityhelpers.middleware.MobileDetectionMiddleware' to your middleware section in
* in your views do a 'from mobilityhelpers import smart_response'


* After installation your should have a 'is_mobile' property on your request instances. You can use this to tune your queryset etc. for mobile devices.
* Instead of using render_to_response use smart_response(request, template_name, context_data).

Configuration options
* You can settings.DISABLE_MOBILITY_HELPERS = False to disable rendering of templates aimed at mobile devices.
* settings.DETECT_MOBILE_FLAVOUR = True will add a specific tag to the template being rendered, ie. for ipad ( the only supported device so far ) will
render index.ipad.html instead of when accessed with an iPad. All other supported mobile devices will use


0.2.0 - Python 3.x support.

0.1.0 - Initial release.

* django

Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date (8.0 kB) Copy SHA256 Checksum SHA256 Source Mar 1, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting