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
Django >= 1.7
Optional
user-agents Adds nicer user agent formatting
GeoIP Looks up City and Country based on IP
django-geoip-utils The lazy way of setting up GeoIP for your project
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
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.1.tar.gz
.
File metadata
- Download URL: django-whoshere-0.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f5236061e70cfb4628d9b51daa64c252134a7a6b18e790b0468f26f01d3c99f |
|
MD5 | d036ebdc92d74cfeac266ca2b6665d4e |
|
BLAKE2b-256 | 12b1fb1b885a7ba90b78ae78eb3b4e6d7e57975d414648007a133781e9d72218 |