标签: django
我正在尝试从视图中登录用户,收到错误'User' object has no attribute 'backend'
'User' object has no attribute 'backend'
from django.contrib.auth import login def confirmation(request): ... user = User.objects.get(id=user_id) login(request, user)
答案 0 :(得分:0)
设置request.user = user
request.user = user