Reference

Middleware

Models

Session Backends

Template Tags

user_sessions.templatetags.user_sessions.device(value)

Transform a User Agent into a human readable text.

Example output:

  • Safari on iPhone
  • Chrome on Windows 8.1
  • Safari on OS X
user_sessions.templatetags.user_sessions.location(value)

Transform an IP address into an approximate location.

Example output:

  • Zwolle, The Netherlands
  • <i>unknown</i>

Views

class user_sessions.views.SessionListView(**kwargs)

View for listing a user’s own sessions.

This view shows list of a user’s currently active sessions. You can override the template by providing your own template at user_sessions/session_list.html.

class user_sessions.views.SessionDeleteView(**kwargs)

View for deleting a user’s own session.

This view allows a user to delete an active session. For example log out a session from a computer at the local library or a friend’s place.

Unit tests