Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

A simple Django app to track IP and User Agent info.

Project description


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::


2. Add useragents to the middleware:
make sure you add this after 'django.contrib.auth.middleware.AuthenticationMiddleware'
of you will get errors

3. Add ipware helpers to settings:
# you can provide your own meta precedence order by
# including IPWARE_META_PRECEDENCE_ORDER in your project's
# The check is done from top to bottom
'HTTP_X_FORWARDED_FOR', 'X_FORWARDED_FOR', # client, proxy1, proxy2

# you can provide your own private IP prefixes by
# including IPWARE_PRIVATE_IP_PREFIX in your project's
# IPs that start with items listed below are ignored
# and are not considered a `real` IP address
'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:

3. Run `python migrate ct_useragents` to create the polls models.

4. Start the development server and visit
see the info on your visitors

Project details

Download files

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

Files for django-ct-useragents, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size django-ct-useragents-0.1.3.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page