Skip to main content

Django middleware that prevents multiple concurrent logins.

Project description

Django middleware that prevents multiple concurrent logins. If a user is already logged into the Django application and tries to log in somewhere else, the previous session is deleted.

This package is based on code from http://stackoverflow.com/a/1814797 and https://gist.github.com/peterdemin/5829440.

Usage

  1. Add “preventconcurrentlogins” to your INSTALLED_APPS settings like this:

    ```python
        INSTALLED_APPS = {
            ...
                'preventconcurrentlogins',
        }
    ```
    
  2. Add “preventconcurrentlogins.middleware.PreventConcurrentLoginsMiddleware” to MIDDLEWARE_CLASSES:

    ```python
        MIDDLEWARE_CLASSES = {
            ...
                'preventconcurrentlogins.middleware.PreventConcurrentLoginsMiddleware',
        }
    ```
    

3. Run python manage.py migrate to create the visitor model that is used to track a users currently active session key.

Project details


Release history Release notifications

This version
History Node

0.8.1

History Node

0.8

History Node

0.7

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-preventconcurrentlogins-0.8.1.tar.gz (4.2 kB) Copy SHA256 hash SHA256 Source None Sep 8, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page