skip to navigation
skip to content

Not Logged In

django-preventconcurrentlogins 0.3

Django middleware that prevents multiple concurrent logins.

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 "preventconcurrentlogs.middleware.PreventConcurrentLoginsMiddleware" to MIDDLEWARE_CLASSES:

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

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

 
File Type Py Version Uploaded on Size
django-preventconcurrentlogins-0.3.tar.gz (md5) Source 2014-02-17 3KB
  • Downloads (All Versions):
  • 4 downloads in the last day
  • 41 downloads in the last week
  • 246 downloads in the last month