django错误笔记——TypeError: view must be a callable or a list/tuple in the case of include().解决办法

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().

解决办法:改为下面的写法

from django.contrib.auth.views import login

...

url(r'^login/$', login, name='login'),

...

原因:

django1.10不再支持 url(r'^login/$', 'django.contrib.auth.views.login', name='login'),这种用法;

  ——摘自https://blog.csdn.net/gavinking0110/article/details/53738362

猜你喜欢

转载自www.cnblogs.com/youleng/p/9047534.html
今日推荐