Skip to main content

Django app to capture, track and display site analytics

Project description

[![Travis CI Build Status](](


Django app to capture, track and display site analytics

pip install dj-analytics

Add to django configuration
* Add `djanalytics` to `INSTALLED_APPS` in file.
* Run ` migrate djanalytics` to create database tables.
* Create and configure at least one Client and Domain.
* In, include djanalytics urls. For example:

urlpatterns += patterns(
(r'', include('djanalytics.urls'))

Use middleware

In, add 'djanalytics.middleware.AnalyticsMiddleware' to the MIDDLEWARE_CLASSES setting
for your django project.

Capture using HTML

var img_html = '<img src="' +
'?dja_id=[client uuid]' +
'&pth=' + escape(window.location.pathname) +
'&qs=' + escape('?')+1)) +
'&rf=' + escape(document.referrer) +
'" style="position:absolute; left: -999px"></img>";

[Read it here](

Change Log
- 0.5
- Fix for issue #1 - capture view raises TypeError
- Fix for issue #2 - allow for use of HTTP_X_FORWARDED_FOR header

- 0.4
- Switched version of django-graphos to fix install issue
- Added in files for Travis CI

- 0.3
- Added 'referrer' to RequestEvent model
- Added more indexes to RequestEvent model
- Added middleware documentation to README

- 0.2
- Switched default for RequestEvent created field to 'now()' instead of 'today()'

- 0.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.

Filename, size & hash SHA256 hash help File type Python version Upload date
dj-analytics-0.5.tar.gz (13.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page