📜  即使用户更改密码 django 也保持用户登录 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:14.138000             🧑  作者: Mango

代码示例1
from django.contrib.auth import authenticate, login, update_session_auth_hash

###after changing password in view
update_session_auth_hash(request, form.user) 
         ###form.user is currentuser also can be accesed from request.user