Registry / database / django-user-sessions

django-user-sessions

JSON →
library2.0.0pypypiunverified

Django sessions with a foreign key to the user, allowing per-user session management. Current version: 2.0.0. Release cadence: sporadic, with major version bumps for Django support drops.

pip install django-user-sessions
INSTALL
IMPORT
SIG · DJANGO-USER-SESSIO
D
django-user-sessions
databasepythonv2.0.0
Install
3.4s avg
Import
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 67.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.4s · import 0.000s · 68MB
66MB installed
● package 66MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SessionStore
from user_sessions.backends.db import SessionStore
from user_sessions.backends.db import SessionStore

Basic setup for django-user-sessions.

INSTALLED_APPS = [ ... 'user_sessions', ... ] SESSION_ENGINE = 'user_sessions.backends.db' MIDDLEWARE = [ ... 'user_sessions.middleware.SessionMiddleware', ... ] # In urls.py from django.urls import path, include urlpatterns = [ path('user_sessions/', include('user_sessions.urls')), ] # Then run migrations and use admin to view sessions.
Debug
Known issues
breakingDjango 2.2+ required. Dropped support for Django <2.2.
fix
Upgrade Django to 2.2 or later.
affects: 2.0.0
deprecatedDjango <1.11 support dropped in version 1.6.0.
fix
Use Django >=1.11.
affects: >=1.6.0
gotchaAfter installing, you must change SESSION_ENGINE and MIDDLEWARE classes, or sessions won't be linked to users.
fix
Set SESSION_ENGINE = 'user_sessions.backends.db' and use 'user_sessions.middleware.SessionMiddleware'.
affects: all
gotchaEnding current session will logout the user. Ensure LOGOUT_REDIRECT_URL is set to avoid redirect issues.
fix
Set LOGOUT_REDIRECT_URL in your Django settings.
affects: >=1.4.0
Upgrade
Version history
2.0.0latest on PyPI · released Dec 13, 2022
Audit
Dependencies
DjangorequiredRequired; supports Django 2.2+
Agent activity
17 hits · last 30 days
node
16
OpenAI (training)
1
Resources
django-user-sessions — pip install django-user-sessions · libregistry