django 修改urls.py 报错误:TypeError: view must be a callable or a list/tuple in the case of include().

#coding=utf-8
from django.conf.urls import include,url
from django.contrib import admin
from blog import views

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^index/$',views.index),
]


改成这种写法:from blog import views , url 不用双引号,直接views.index

posted @ 2017-05-09 16:15  liuzhipenglove  阅读(3150)  评论(0编辑  收藏  举报