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
Django >= 1.7
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
Install user-agents for nicer user agent formatting
Install django-ipware for a better way to determine real ip addresses.
Configure GeoIP or just install django-geoip-utils for geo location of your users
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-whoshere-0.1.2.tar.gz
.
File metadata
- Download URL: django-whoshere-0.1.2.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63620d10785e28a0f6822615a28667496f9fdb3a63216cdba0bcc0f168060b4f |
|
MD5 | 428f940cfe84445d8ba034a87969b90e |
|
BLAKE2b-256 | b3d27daa3eb4b2c3e8dc1dadd364c43c950f80fd12ae5f4767f2d9d6cb97f30e |