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

原文地址:https://www.cnblogs.com/youleng/p/9047534.html

时间: 2024-10-07 03:35:21

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

Django urls.py报错: raise TypeError('view must be a callable or a list/tuple in the case of include()

Django urls.py报错: raise TypeError('view must be a callable or a list/tuple in the case of include() 报错信息 "F:\PyCharm 2016.2.2\bin\runnerw.exe" C:\Users\Administrator\AppData\Local\Programs\Python\Python35\python.exe F:/Django/blogs/manage.py run

TypeError: view must be a callable or a list/tuple in the case of include()

原文连接: http://www.imooc.com/qadetail/98920 我是这么写的就好了 from django.conf.urls import url from django.contrib import admin from blogapp import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'helloworld',views.hello) ] django 1.10版本改了写法了.首先要在

django 运行报错view must be a callable or a list/tuple in the case of include()

网上找了相关资料发现 django 1.10之后不在支持URL用字符串表示了 http://stackoverflow.com/questions/38744285/django-urls-error-view-must-be-a-callable-or-a-list-tuple-in-the-case-of-includ 那我们换种写法, from myindex.bb import hi import myindex urlpatterns = [ url(r'^admin/', admin

Django URLs error: view must be a callable or a list/tuple in the case of include()

我现在的Django version 是 1.11.2, the folling solution is come from stackoverflow:==================================================================-----question: After upgrading to Django 1.10,I get the error: TypeError: view must be a callable or a list

django错误笔记(xadmin)——AttributeError: 'Settings' object has no attribute 'TEMPLATE_CONTEXT_PROCESSORS'

使用Xadmin,执行makemigrations和migrate时运行报错提示: AttributeError: 'Settings' object has no attribute 'TEMPLATE_CONTEXT_PROCESSORS' 方法一: setting.py文件添加以下信息: TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_pr

python3错误之TypeError: 'dict_items' object is not callable

这种错误出现在循环结构中套循环结构,而循环时内部循环为字典,外部循环为该字典调用items方法后取到的值,内部循环调用外部循环中遍历的结果: 解决方案: 将外部循环的items()方法调用改为.keys() or .values()然后在内部循环中调用即可 python3错误之TypeError: 'dict_items' object is not callable

[小问题笔记(三)] SVN树冲突(Tree Conflict),文件不能提交的解决办法

传说中SVN的树冲突是由不同开发者删除文件,移动文件神马的造成的. 我们遇到的情况是: 开发人员小B移动了项目中几个文件然后提交.开发人员小L更新项目至最新版本. 获取到移动后的文件则显示文件已被修改,此时,不能提交,也不能还原,提示“树冲突”. 解决办法: 在上面的提交页面,有冲突的项目上右键==>Subversion==>Resolve(好像是这个词)==>使用工作区副本(类似的,具体记不清了) 然后“确定”就可以正常提交了. [小问题笔记(三)] SVN树冲突(Tree Confl

Silverlight无法启动调试,错误“Unable to start debugging. The Silverlight Developer Runtime is not installed. Please install a matching version.” 解决办法

今天调试Silverlight出现了以下错误: 意思是“无法启动调试,因为Silverlight Developer Runtime没有安装,请安装一个匹配的版本”.但是按Ctrl + F5可以调试运行,不对啊,前几天还好好的,今天怎么就不行了呢? 突然想起来,前几天Silverlight升级了,于是卸载Silverlight SDK重装,还是有这个错误.下面给出解决办法: 卸载Microsoft Silverlight 然后重装Silverlight4_Tools.exe,或者解压Silver

Django错误笔记1

错误联系, 之前使用pycharm写的Django的时候,每当我更改玩setting的设置后,会出现错误如下, /usr/bin/python /home/peggy/PycharmProjects/DDjango/NewRec/manage.py runserver 8000Traceback (most recent call last): File "/home/peggy/PycharmProjects/DDjango/NewRec/manage.py", line 10, i