django开发问题总结
报错如下
NoReverseMatch at /blog/
Reverse for 'blog_detail' with keyword arguments '{'blog_id': 10}' not found. 1 pattern(s) tried: ['blog/detail/(?P[1-9]+)/$']
将
url(r'^detail/(?P<blog_id>[1-9]+)/$', views.detail,name='blog_detail'),
改为
url(r'^detail/(?P<blog_id>d+)/$', views.detail,name='blog_detail'),
#或改为
url(r'^detail/(?P<blog_id>[0-9]+)/$', views.detail,name='blog_detail'),