为了账号安全,请及时绑定邮箱和手机立即绑定

为什么django 2中urlpatterns没有起作用?

为什么django 2中urlpatterns没有起作用?

碳酸14 2018-05-28 00:54:42
按照django官方教程建了项目,在项目根目录建了urls.py创建了urlpatterns,在plots目录下的urls再指向views中的httpspone:urlpatterns = [     path('admin/', admin.site.urls),     path('plotss/', include('plots.urls'))   ]但打开网页,发现没有识别到‘plotss/'这个path,提示:Using the URLconf defined in DemoMap.urls,      Django tried these URL patterns, in this order:     admin/     The current path, plotss, didn't match any of these. 为什么会这样呢?
查看完整描述

1 回答

?
碳酸14

TA贡献1条经验 获得超0个赞

找到问题了,

ROOT_URLCONF = 'DemoMap.urls'

这个路径理解错了 /捂脸

查看完整回答
反对 回复 2018-05-28
  • Sunny_SunshineX
    Sunny_SunshineX
    楼主你是怎么搞定的 我用的是Django2.2跟你这种路径配置一样,也是跟你报一样的错
  • 沧海遗墨
    沧海遗墨
    我也报错了,你解决了么
  • 1 回答
  • 0 关注
  • 2984 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信