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
Add “preventconcurrentlogins” to your INSTALLED_APPS settings like this:
```python INSTALLED_APPS = { ... 'preventconcurrentlogins', } ```
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Hashes for django-preventconcurrentlogins-0.7.zip
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5aa581d0d6a8e97de58f28aa80d28e06461106444a7d32d6ebe259d2389a42ed |
|
MD5 | fb10fbc255a2d8dc977d775f5719aac2 |
|
BLAKE2b-256 | 955472c3162570a43708a954cc896e916fb8dff9cb70e6836038f1e36a449e09 |
Hashes for django-preventconcurrentlogins-0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ad66366e320e57e17109ded6d031696ae1d64d559ce72728c0e025e09459546 |
|
MD5 | eb9731a0f79329a46c660d74e2795dcc |
|
BLAKE2b-256 | 826babaeff01f3181719e2e7d9393dffff7fed3dacf778003ab370dc96cfb7c7 |