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

Posted 暮归

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了django 运行报错view must be a callable or a list/tuple in the case of include()相关的知识,希望对你有一定的参考价值。

  

  网上找了相关资料发现

  django 1.10之后不在支持URL用字符串表示了 
http://stackoverflow.com/questions/38744285/django-urls-error-view-must-be-a-callable-or-a-list-tuple-in-the-case-of-includ

  那我们换种写法,

  from myindex.bb import hi
  import myindex

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

  测试通过,OK

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

Django URLs error: 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 error: view must be a callable or a list/tuple in the case of include()

parameter must be a descendant of this view 报错解决方案及Android 获取View焦点源码分析

django通用视图Generic detail view PublisherList must be called with either an object pk or a slug

Django TypeError: isinstance() arg 2 must be a type or tuple of types