django错误笔记——TypeError: view must be a callable or a list/tuple in the case of include().解决办法
Posted 犹冷
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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
以上是关于django错误笔记——TypeError: view must be a callable or a list/tuple in the case of include().解决办法的主要内容,如果未能解决你的问题,请参考以下文章