Logs all sessions and sign-outs. Originally developed at [en.ig.ma software shop].
- logging all sessions permanently
- logging off remote sessions
- logging of IP addresses and browser info
Basic Installation that will provide you with admin view of all session logs:
- Include
django-session-login yourrequirements.txtfile. - Add
session_logtoINSTALLED_APPSand migrate db.
Optionally you can add view that lets your users see all of their active sessions and log out them.
-
Add
session_activity.middleware.SessionActivityMiddlewaretoMIDDLEWARE_CLASSESafter thedjango.contrib.sessions.middleware.SessionMiddlewareanddjango.contrib.auth.middleware.AuthenticationMiddlewaremiddleware classes. This step is optional and only required if you intend user to be able to see all his active sessions and log out them -
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.htmltemplate to match your look and feel expectations.
django-session-log depends on django>=1.11.2,
django-appconf>=0.6 and python-dateutil.
There’s also an instant demo example that can be run from the cloned repository:
./manage.py migrate
./manage.py runserver
django-session-log is released under the MIT license.
- Original GitHub repository - https://github.com/nigma/django-session-activity
- Original PyPi Package site - http://pypi.python.org/pypi/django-session-activity