django-activeusers python

django-activeusers aims to keep track of currently active users on Django-powered Web sites.

4 years after

django-activeusers aims to keep track of currently active users on Django-powered Web sites.

It is a reworked, simplified fork of django-tracking located at


  • Tracks the following information about your visitors:

    • Session key
    • IP address
    • User agent
    • Whether or not they are a registered user and logged in
    • Where they came from (http-referer)
    • What page on your site they last visited
    • How many pages on your site they have visited
  • Automatic clean-up of old visitor records

  • The ability to have a live feed of active users on your website

  • Template tags to:

    • display how many active users there are on your site
    • determine how many active users are on the same page within your site


  • Django 1.2+


Download django-activeuesers using one of the following methods:


pip install -e git+


First of all, you must add this project to your list of INSTALLED_APPS in


Run syncdb. This creates a few tables in your database that are necessary for operation.

Depending on how you wish to use this application, you have a few options:

Visitor Tracking

Add django-activeusers.middleware.VisitorTrackingMiddleware to your MIDDLEWARE_CLASSES in It must be underneath the AuthenticationMiddleware, so that request.user exists.

Automatic Visitor Clean-Up ++++++++++++++++++++++++++

If you want to have Django automatically clean past visitor information out your database, put django-activeusers.middleware.VisitorCleanUpMiddleware in your MIDDLEWARE_CLASSES.

Visitors on Page (template tag)

Make sure that django.core.context_processors.request is somewhere in your TEMPLATE_CONTEXT_PROCESSORS tuple. This context processor makes the request object accessible to your templates. This application uses the request object to determine what page the user is looking at in a template tag.

If you don't want particular areas of your site to be tracked, you may define a list of prefixes in your using the ACTIVEUSERS_IGNORE_PREFIXES. For example, if you didn't want visits to the /family/ section of your website, set ACTIVEUSERS_IGNORE_PREFIXES to ['/family/'].

By default, active users include any visitors within the last 10 minutes. If you would like to override that setting, just set ACTIVEUSERS_TIMEOUT to however many minutes you want in your

For automatic visitor clean-up, any records older than 24 hours are removed by default. If you would like to override that setting, set ACTIVEUSERS_CLEANUP_TIMEOUT to however many hours you want in your

Good luck! Please contact me with any questions or concerns you have with the project!

Related Repositories



Modifications to Backbone's Model an Collection so that they play nice with djan ...

Top Contributors

invalid-email-address asavoy codekoala jezdez ramusus lkarsten krone


-   v0.1.0 zip tar
-   0.3.7 zip tar
-   0.3.5 zip tar
-   0.3.3 zip tar
-   0.3.2 zip tar
-   0.3.1 zip tar
-   0.3.0 zip tar
-   0.1.4 zip tar
-   0.1.2 zip tar
-   0.1.1 zip tar
-   0.1.0 zip tar