"is_mobile" middleware for Django
Requires Django 2.0 or later.
Install with pip
or your favorite PyPi package manager.
pip install django-ismobile
Include MobileControlMiddleware into your MIDDLEWARE:
MIDDLEWARE = (
...
'ismobile.middleware.MobileControlMiddleware',
...
)
In order to change request attribute name, set IS_MOBILE_ATTR_NAME in django settings file.
IS_MOBILE_ATTR_NAME="custom_name"