List all active sessions and sign-out from all sessions opened on other computers.
Developed at en.ig.ma software shop.
This app records and shows last session activity and allows users to sign-out from all active sessions, even remote ones.
In other words, it handles the following use case:
You come back home and realize that you forgot to log out on your work/university/other remote computer. What now?
You take a look at the recent active sessions for your account and click a single button to deactivate all sessions opened on other computers.
Include
django-session-activity
in yourrequirements.txt
file.Add
session_activity
toINSTALLED_APPS
and migrate/syncdb.Add
session_activity.middleware.SessionActivityMiddleware
toMIDDLEWARE_CLASSES
after thedjango.contrib.sessions.middleware.SessionMiddleware
anddjango.contrib.auth.middleware.AuthenticationMiddleware
middleware classes.Add url config for session list and sign-out views:
url(r'^sessions/', include('session_activity.urls')),
Then link to the main view using
{% url "session_activity_list" %}
template tag.Optionally copy & modify the
session_list.html
template to match your look and feel expectations.
django-session-activity
depends on django>=1.5.0
, django-appconf>=0.6
and python-dateutil
.
The full documentation is at http://django-session-activity.rtfd.org (TODO).
There's also an instant demo example that can be run from the cloned repository:
python demo.py
django-session-activity is released under the MIT license.
- GitHub repository - https://github.com/nigma/django-session-activity
- PyPi Package site - http://pypi.python.org/pypi/django-session-activity