Access request.session from backend.get_user

前端 未结 3 1117
谎友^
谎友^ 2020-12-14 22:46

first of all: this is not the same as this. The ModelBackend has no request member.

I want to access the session of the current user without ac

3条回答
  •  粉色の甜心
    2020-12-14 23:25

    The RemoteUserBackend (from django.contrib.auth.backends) uses special middleware, RemoteUserMiddleware, to access request data. Maybe you could do it this way, too.

提交回复
热议问题