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

时间:2022-06-21 17:03:42

这个错误的原因是django 1.10之后不在支持URL用字符串表示了 
http://*.com/questions/38744285/django-urls-error-view-must-be-a-callable-or-a-list-tuple-in-the-case-of-includ

真的好烦这种的,明明按着教程来的,都还会报错,真是~!@#$%^&*

那我们换种写法,

  

from blog.views import hello

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^helloworld', hello)
]