You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use SESSION_ENGINE = 'django.contrib.sessions.backends.cache' setting in my projects.
django-private-chat however fails with django.contrib.sessions.models.DoesNotExist: Session matching query does not exist., which means that it uses django.contrib.sessions.models.Session directly, ignoring the configured session engine.
The text was updated successfully, but these errors were encountered:
UPDATE:
a quick fix is to change the get_user_from_session in utils.py into the following:
`
async def get_user_from_session(session_key):
session_key = "django.contrib.sessions.cache{}".format(session_key)
session = cache.get(session_key)
if session:
uid = session['_auth_user_id']
user = get_user_model().objects.filter(id=uid).first() # get object or none
return user
else:
return None
Description
I use
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
setting in my projects.django-private-chat however fails with
django.contrib.sessions.models.DoesNotExist: Session matching query does not exist.
, which means that it usesdjango.contrib.sessions.models.Session
directly, ignoring the configured session engine.The text was updated successfully, but these errors were encountered: