Skip to main content

Monitoring of active users in Django using Redis

Project description

Requirements

  • Python: 2.7

  • Django: 1.6, 1.7

  • Django-redis: 4.30

Install

pip install django-active-users

Setup

Your django application should already be setting of Redis cache. See more in django-redis official documentation.

Add active_users.middleware.ActiveUsersSessionMiddleware to your project’s MIDDLEWARE_CLASSES after the SessionMiddleware:

MIDDLEWARE_CLASSES = (
    ...
    'django.contrib.sessions.middleware.SessionMiddleware',
    'active_users.middleware.ActiveUsersSessionMiddleware',
    ...
)

Settings

ACTIVE_USERS_KEY_EXPIRE - Time of key expire (interval after the last request during which the visitor is considered active) in seconds. Default is 20.

ACTIVE_USERS_EXCLUDE_URL_PATTERNS - A list of regular expressions that will be matched against the request.path_info. If they are matched, the visitor (and pageview) key will not be create.

ACTIVE_USERS_KEY_CLASS - Class of visitor key entry. It should inherited from active_users.keys.AbstractActiveUserEntry. Default active_users.keys.ActiveUserEntry

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

django-active-users-0.0.1.3.tar.gz (3.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page