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下