I have 2 URL's with a slug field in the URL.
url(r'^genres/(?P<slug>.+)/$', views.genre_view, name='genre_view'),
url(r'^genres/(?P<slug>.+)/monthly/$', views.genre_month, name='genre_month'),
The first one opens fine but the second one gives a DoesNotExist
error saying Genres matching query does not exist
.
Here is how I'm accessing the 2nd URL in my HTML
<li><a href="{% url 'genre_month' slug=genre.slug %}">Monthly Top Songs</a></li>
I tried to print the slug in the view. It is passed as genre_name/monthly
instead instead of genre_name
.
I think the problem is with the regex in the URLs. Any idea what's wrong here?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…