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

Posted 扫驴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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版本改了写法了。首先要在引入view模块,其次后面URL设置里views.hello不要加引号了。

在本文中,django-admin.py startproject blogapp

views.py在目录 ~/blogapp/blogapp下

以上是关于TypeError: view must be a callable or a list/tuple in the case of include()的主要内容,如果未能解决你的问题,请参考以下文章

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 includ

python TypeError: must be str, not bytes错误

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

Python. 报错: TypeError: issubclass() arg 1 must be a class

Python_异常:TypeError: write() argument must be str, not list