Device browser detection in Django
Project description
Django Mobile Detector
Mobile Detect is a lightweight Python package for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
PHP
this package development based from php big repository Mobile-Detect
Installation
Python package install:
pip install django-mobile-detect
Add `mobiledetect` to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'mobiledetect', ]
Middleware:
MIDDLEWARE_CLASSES = ( '...', 'mobiledetect.middleware.DetectMiddleware', '...' )
View Usage
You can use in views
Check if the device is mobile.
request.device.is_mobile
Check if the device is a tablet.
request.device.is_tablet
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-mobile-detect-0.1.tar.gz
(25.4 kB
view hashes)