django-user-sessions
django-user-sessions copied to clipboard
Django 2.2 fails to load with user_sessions
When loading with Django 2.2, Django returns an error stating 'django.contrib.sessions' must be in INSTALLED_APPS in order to use the admin application.
I'm not sure if the session app registration has changed with the latest Django, but this wasn't an issue with 2.1.x
.
Related upstream ticket, FWIW.
On Django 2.2 with adding django.contrib.sessions app to INSTALLED APPS, user sessions still worked and everything was fine. Now in Django 2.2.1 they require the SessionMiddleware from django which apparently does not work properly with user sessions middleware, because I cannot login a user anymore from the backend. I do not know if there is something wrong in user sessions or in Django now, but I hope someone can shed some light on this please. Thanks in advance! See my response to the upstream ticket
The fix in django-user-sessions
is to simply derive DUS's middleware from the built-in middleware instead of just MiddlewareMixin
.
For a quick workaround before that's implemented, as per my reply in https://github.com/django/django/pull/11166#issuecomment-488683671 , one can do this in application code:
class UserSessionsMiddleware(
user_sessions.middleware.SessionMiddleware,
django.contrib.sessions.middleware.SessionMiddleware,
):
pass
I've had success with specifying the following setting, does that work for you?
SILENCED_SYSTEM_CHECKS = ['admin.E410']
I am facing this issue right know, but i do not think that doing
SILENCED_SYSTEM_CHECKS = ['admin.E410']
is the best way to solve it, is there any other way ? because pip install django-user-sessions is still giving this error on django 2.2.3
in 2.2.11 the issue is gone.
I'm still seeing this issue in 2.2.13