=====
This application adds attributes to your request object that describe the users browser. This will let you fine tune the templates or code to use based on the traits of the browser.
The following is currently added to the request:
Simple Device
-------------
request.is_simple_device
True for all non-desktop devices (browsers) without "modern" CSS and JS support. This includes non "smart" phones and simpler browsers like those found on game consoles and the kindle.
Touch Device
------------
request.is_touch_device
True for devices that use touch events.
Wide Device
-----------
request.is_wide_device
True for devices that are wider than a common mobile phone. This covers tablets and desktop browsers.
Device Type
-----------
request.is_ios_device
request.is_ios5_device
request.is_android_device
request.is_webos_device
request.is_windows_phone_device
request.is_kindle_device
True if the device is part of the given platform.
These give more granular information about modern smart devices. This is helpful if you want to target features to a specific device type.
Other Attributes
----------------
request.is_webkit
True if the browser is webkit (desktop or mobile.)
Installation
============
After you've added browser_info to your python path (manually or with pip) you can access its attributes with one of two methods.
All Requests
------------
To use browser_info on all requests just add
browser_info.Middleware
to the `MIDDLEWARE_CLASSES` tuple in your settings.py
Specific Requests
-----------------
If you only have certain views that need the distinction all you need to do is wrap the relevant views like this:
from browser_info import add_browser_info
@add_browser_info
def my_mobile_view(request):
# your view code here.
Metadata
Release files for django-browser-info 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-browser-info-1.0.1.tar.gz | 4.7 kB | Without provenance | Details for django-browser-info-1.0.1.tar.gz |
Release files / django-browser-info-1.0.1.tar.gz
| Download URL | django-browser-info-1.0.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce8e7f55e5dc1da8a169958e99bbb985495d06e0c8ab5e3e51349fe6d83baeb0
|
|
BLAKE2b-256 checksum How to use checksums |
bf1fb5fe128c0ecd4f0e5441b1f1a4481eef92df3430a5422e9b82430e41e2ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-browser-info 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.