Skip to main content

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.

Metadata

Release files for django-preventconcurrentlogins 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-preventconcurrentlogins 0.8.1
File Size Uploaded
django-preventconcurrentlogins-0.8.1.tar.gz 4.2 kB Details

Release files / django-preventconcurrentlogins-0.8.1.tar.gz

Download URL django-preventconcurrentlogins-0.8.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2260ae341460a69c7a0d653ef6d0808331dffed2a57f47a695f9654b9f125c02
BLAKE2b-256 checksum
How to use checksums
87dd3956d2232437e377c47256684d35ffd18f811cc1fafbd38ecbc1f31f30e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.8.2

1 release file

This release

0.8.1 This release

1 release file

0.8

0.7

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page