我有一个有urls.py
的音乐应用urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^(?P<album_id>[0-9]+)/$', views.detail, name='detail'),
url(r'^(?P<album_id>[0-9]+)/favorite/$', views.favorite, name='favorite'),
]
在我的html代码中我称之为
<form action="{% url 'music:favorite' album_id %}" method="post">
然后我得到NoReverseMatch异常。
Reverse for 'favorite' with arguments '('',)' not found. 1 pattern(s) tried: ['music/(?P<album_id>[0-9]+)/favorite/$']