Skip to main content

A reusable Django app that will invalidate all active sessions after change password.

Project description

https://badge.fury.io/py/django-password-session.png https://api.travis-ci.org/alikus/django-password-session.png https://coveralls.io/repos/alikus/django-password-session/badge.png?branch=master

Installation

  1. Install a package.

$ pip install django-password-session
  1. Add “password_session” to your INSTALLED_APPS setting:

INSTALLED_APPS = (
    ...
    'password_session',
)
  1. Add middleware:

MIDDLEWARE_CLASSES = (
    ...
    'password_session.middleware.CheckPasswordHash',
),
  1. Make sure that you have the following settings:

INSTALLED_APPS = (
    ...
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
)

AUTHENTICATION_BACKENDS = (
    ...
    'django.contrib.auth.backends.ModelBackend',
)

MIDDLEWARE_CLASSES = (
    ...
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
)

Settings

Default application settings can be overriden in settings.py:

PASSWORD_SESSION_PASSWORD_HASH_KEY = 'password_session_password_hash_key' #  default key stored in session
PASSWORD_SESSION_PASSWORD_HASH_LENGTH = 4 #  default key length

Requirements

  • Python 2.6+ or 3+

  • Django 1.3+

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-password-session-0.1.tar.gz (3.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page