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

时间:2021-12-31 17:03:31

原文:http://www.cnblogs.com/mgwm/p/6364597.html


view must be a callable or a list/tuple in the case of include()

是因为django 1.10之后不在支持URL用字符串表示了 ;或者定义的url存在问题

所以修改 urls.py 中的定义url即可

  from myindex.bb import hi
  import myindex

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