skip to navigation
skip to content

django-detect 1.0.5

Django UserAgent Detect

Installation

pip install django-detect

Usage

# ####### Device、OS #######
# Windows
request.Windows
# Linux
request.Linux
# iMac/iPhone/iPad/iPod
request.iMac
request.iPhone
request.iPad
request.iPod
# PC
request.PC = request.Windows or request.Linux or request.iMac
# iOS
request.iOS = request.iPhone or request.iPad or request.iMac or request.iPod
# Android and Version
request.Android
request.Android.version

# ####### APP #######
# Weixin/Wechat and Version
request.weixin
request.weixin.version
request.wechat
request.wechat.version

Settings.py

# Use `MIDDLEWARE_CLASSES` prior to Django 1.10
MIDDLEWARE = (
    ...
    'detect.middleware.UserAgentDetectionMiddleware',
    ...
)
 
File Type Py Version Uploaded on Size
django-detect-1.0.5.tar.gz (md5) Source 2016-10-19 2KB
django_detect-1.0.5-py2.7.egg (md5) Python Egg 2.7 2016-10-19 3KB