Skip to main content

Django UserAgent Detect

Project description

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',
    ...
)

Project details


Download files

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

Source Distribution

django-detect-1.0.20.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

django_detect-1.0.20-py2.py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page