Skip to main content

Django Admin plugin to see who is logged in and active. Supports GeoIp and user-agents.

Project description

A simple Django Admin plugin showing who’s logged in and active on your site using the cache. Supports GeoIP and user-agents .

Requirements

Optional

Installation

  • Make sure you have Django’s Cache backend set up.

  • Install using pip: pip install django-whoshere

  • Add django_whoshere to INSTALLED_APPS in settings.py:

    INSTALLED_APPS = (
        # other apps
        'django_whoshere',
    )
  • Add django_whoshere.middelware.TrackMiddleware to your MIDDLEWARE_CLASSES. Make sure it comes after your Authentication middleware.

MIDDLEWARE_CLASSES = (
    # other middleware
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django_whoshere.middleware.TrackMiddleware',
   # more middleware
)

Optional

Configuration

No configuration is needed but these settings are provided for convenience:

  • WHOSHERE_TIMEOUT=300 Sets the timeout for user activity. Defaults to 300 seconds.

  • WHOSHERE_LABEL='Active Users' Overrides the admin link label. Defaults to ‘Active Users’

  • WHOSHERE_PREFIX='whoshere' Prefix used in cache keys. Defaults to ‘whoshere’.

Notes

  • Middleware is kept as small as possible and only adds IP and User Agent to the cache for the current logged in user.

  • No database tables are used. Instead WhosHere uses a proxy model of the User model.

  • Proxy models will create migrations but do not affect your database

Todo

  • Add tests

  • Think of other things to add

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-whoshere-0.1.1.tar.gz (5.3 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