Django device recognizing utility.
Project description
WebCase device recognizing utility
Installation
pip install wc-django-device-recognizer
It depends on django-user-agents
, so check out it's documentation about additional installation instructions.
In settings.py
:
INSTALLED_APPS += [
'wcd_device_recognizer',
]
Usage
To get all possible information from request:
from wcd_device_recognizer.services import request_resolver
interlocutor = request_resolver.resolve(request)
assert interlocutor.device.bitness == '64'
assert interlocutor.os.family == 'Linux'
assert interlocutor.os.arch == 'x86'
assert interlocutor.app.family == 'Chrome'
assert interlocutor.app.version == (101, 0, 0)
assert interlocutor.device.dpr == 1
And then you may save interlocutor's data to database:
from wcd_device_recognizer.services import registry
# You may pass any amount of interlocutors to register here.
registry.register_interlocutors((interlocutor,))
```# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.1.4]
### Added
- Translation strings.
## [0.1.1]
Initial version.
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
Close
Hashes for wc-django-device-recognizer-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c770c152ec0f4cb61975f91a53967b9cf98086cfd4d33a53937951c0ed04ec17 |
|
MD5 | 1de0102434f3a19a99c7c2a7809993bf |
|
BLAKE2b-256 | 0c14596411ff968b30c96c6151f2f7831839da405c4e3fc7c9b9e3a7ec552a66 |