Useragents
=====
Useragents is a simple app to track the user agents, ips and other info
of the various visitors of your django site. The information is stored in
the database for easy reference and exporting.
Quick start
-----------
1. Add "ct_useragents" and "ipware" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'ipware',
'ct_useragents',
]
2. Add useragents to the middleware:
make sure you add this after 'django.contrib.auth.middleware.AuthenticationMiddleware'
of you will get errors
MIDDLEWARE_CLASSES = [
...
'useragents.utils.UserAgentsMiddleware',
...
]
3. Add ipware helpers to settings:
# you can provide your own meta precedence order by
# including IPWARE_META_PRECEDENCE_ORDER in your project's
# settings.py. The check is done from top to bottom
IPWARE_META_PRECEDENCE_ORDER = (
'HTTP_X_FORWARDED_FOR', 'X_FORWARDED_FOR', # client, proxy1, proxy2
'HTTP_CLIENT_IP',
'HTTP_X_REAL_IP',
'HTTP_X_FORWARDED',
'HTTP_X_CLUSTER_CLIENT_IP',
'HTTP_FORWARDED_FOR',
'HTTP_FORWARDED',
'HTTP_VIA',
'REMOTE_ADDR',
)
# you can provide your own private IP prefixes by
# including IPWARE_PRIVATE_IP_PREFIX in your project's setting.py
# IPs that start with items listed below are ignored
# and are not considered a `real` IP address
IPWARE_PRIVATE_IP_PREFIX = (
'0.', # externally non-routable
'10.', # class A private block
'169.254.', # link-local block
'172.16.', '172.17.', '172.18.', '172.19.',
'172.20.', '172.21.', '172.22.', '172.23.',
'172.24.', '172.25.', '172.26.', '172.27.',
'172.28.', '172.29.', '172.30.', '172.31.', # class B private blocks
'192.0.2.', # reserved for documentation and example code
'192.168.', # class C private block
'255.255.255.', # IPv4 broadcast address
) + (
'2001:db8:', # reserved for documentation and example code
'fc00:', # IPv6 private block
'fe80:', # link-local unicast
'ff00:', # IPv6 multicast
)
for more info check django-ipware git repo: https://github.com/un33k/django-ipware
3. Run `python manage.py migrate ct_useragents` to create the polls models.
4. Start the development server and visit http://127.0.0.1:8000/admin/
see the info on your visitors
Metadata
Release files for django-ct-useragents 0.1.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 | |
|---|---|---|---|---|
| django-ct-useragents-0.1.1.tar.gz | 5.9 kB | Without provenance | Details |
Release files / django-ct-useragents-0.1.1.tar.gz
| Download URL | django-ct-useragents-0.1.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9eb794061fef0cac037e23942d669a481add17ef0e6ad5ad9e0686ca16ade3e1
|
|
BLAKE2b-256 checksum How to use checksums |
7a5eb73f6a6927889972691ac0e10015c291ce65aa710d5673a92f3531bb46b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-ct-useragents 0.1.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.