我是Django的新手,我正在尝试在其中创建示例项目。请帮助我解决这个错误。
我的主URLs.py文件
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^t20_predict/', include('PredictMatch.urls')),
]我的应用程序URLs.py文件
app_name = 'PredictMatch'
urlpatterns = [
# t20_predict/T20
url(r'^T20/$', views.t20index, name='t20index'),
]发布于 2018-10-28 15:00:34
加酶
url(r'^T20/$', views.t20index, name='t20index')您不需要任何id,url只是t20_predict/T20/ ->,这里没有id
如果您希望url也接收id,url模式应该是
url(r'^T20/(?P<id>[0-9]+)/$', views.t20index, name='t20index')https://stackoverflow.com/questions/53032708
复制相似问题