Django 版本 1.10.7
我收到 TypeError: authenticate() takes exactly 0 arguments (3 given)
像这样导入 authenticate():
from django.contrib.auth import authenticate, login
像这样调用 authenticate() :
验证(请求,username=request.POST['username'],password=request.POST['password'])
最佳答案
在 1.10 中 authenticate
不接受位置参数 ( docs )
称之为
authenticate(username=request.POST['username'], password=request.POST['password'])
关于python - Django 类型错误 : authenticate() takes exactly 0 arguments (3 given),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45927704/