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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM