Answer the question
In order to leave comments, you need to log in
Django why url not working?
url.py:
url(r'^other/(?P<category>[\w\-]+)/(?P<subcategory>\d+)/$', views.other_category, name='other_subcategory'),
{% url 'other_subcategory' cat sub.id %}
NoReverseMatch at /other/appliances/13/
Reverse for 'other_subcategory' with arguments '('', 10)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['other/(?P[\\w\\-]+)/(?P\\d+)/$']
Request Method: GET
Request URL: 127.0.0.1:8000/other /appliances/13
Django Version: 1.9.7
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'other_subcategory' with arguments '('', 10)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['other/(?P[\\w\\-]+)/(?P\\d+)/$']
{% url 'other_subcategory' category=cat subcategory=sub.id %}
NoReverseMatch at /other/appliances/13/
Reverse for 'other_subcategory' with arguments '()' and keyword arguments '{'subcategory': 10, 'category': ''}' not found. 1 pattern(s) tried: ['other/(?P[\\w\\-]+)/(?P\\d+)/$']
Request Method: GET
Request URL: 127.0.0.1:8000/other /appliances/13
Django Version: 1.9.7
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'other_subcategory' with arguments '()' and keyword arguments '{'subcategory': 10, 'category': ''}' not found. 1 pattern(s) tried: ['other/(?P[\\w\\-]+)/(?P\\d+)/$']
Answer the question
In order to leave comments, you need to log in
I suspect that everything is fine with the first link, the problem is with the link that should be on the page with the url /other/appliances/13/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question