TypeError: view must be a callable or a list/tuple in the case of include().解决办法
1、django增加用户认证模块时,总是提醒模块的url.py中 url(r’^login/$’, ‘django.contrib.auth.views.login’, name=’login’),出错:
TypeError: view must be a callable or a list/tuple in the case of include().
2、折腾了很多种办法,找了很多原因,最后找到了症结所在:django1.10不再支持 url(r’^login/$’, ‘django.contrib.auth.views.login’, name=’login’),这种用法;
3、把上面的语句改为:
from django.contrib.auth.views import login
…
url(r’^login/$’, login, name=’login’),
…
问题解决
总结:做软件升级的人能不能在这种容易因为升级而出错的地方多给些提示呢!!!
还没有评论,来说两句吧...