Skip to main content

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

Project description

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

Requirements

Optional

  • user-agents Adds nicer user agent formatting

  • django-ipware More robust way of determining a users IP

  • GeoIP Looks up City and Country based on IP

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.2.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file django-whoshere-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django-whoshere-0.1.2.tar.gz
Algorithm Hash digest
SHA256 63620d10785e28a0f6822615a28667496f9fdb3a63216cdba0bcc0f168060b4f
MD5 428f940cfe84445d8ba034a87969b90e
BLAKE2b-256 b3d27daa3eb4b2c3e8dc1dadd364c43c950f80fd12ae5f4767f2d9d6cb97f30e

See more details on using hashes here.

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