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

按照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:     

  1. admin/     

The current path, plotss, didn't match any of these. 

为什么会这样呢?

碳酸14
浏览 2985回答 1
1回答

碳酸14

找到问题了,ROOT_URLCONF = 'DemoMap.urls'这个路径理解错了 /捂脸
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

WebApp
Python