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.
Metadata
Release files for django-preventconcurrentlogins 0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | |
|---|---|---|---|
| django-preventconcurrentlogins-0.7.zip | 9.6 kB | Details | |
| django-preventconcurrentlogins-0.7.tar.gz | 4.3 kB | Details |
Release files / django-preventconcurrentlogins-0.7.zip
| Download URL | django-preventconcurrentlogins-0.7.zip |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5aa581d0d6a8e97de58f28aa80d28e06461106444a7d32d6ebe259d2389a42ed
|
|
BLAKE2b-256 checksum How to use checksums |
955472c3162570a43708a954cc896e916fb8dff9cb70e6836038f1e36a449e09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django-preventconcurrentlogins-0.7.tar.gz
| Download URL | django-preventconcurrentlogins-0.7.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ad66366e320e57e17109ded6d031696ae1d64d559ce72728c0e025e09459546
|
|
BLAKE2b-256 checksum How to use checksums |
826babaeff01f3181719e2e7d9393dffff7fed3dacf778003ab370dc96cfb7c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |