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

时间:2021-07-02 17:02:15
#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