3👍
✅
Your category()
view expects the category_name_url
parameter:
def category(request, category_name_url):
...
But in the urls.py
your define the category_name_slug
parameter:
url(r'category/(?P<category_name_slug>[\w\-]+)/$', views.category,
name='category'),
Make the parameter equal in both places. For example:
def category(request, slug):
...
But in the urls.py
your define the category_name_slug
parameter:
url(r'category/(?P<slug>[\w\-]+)/$', views.category, name='category'),
2👍
You should change your url definition to:
url(r'category/(?P<slug>[\w\-]+)/$', views.category, name='category')
- [Django]-Django data passing with a tag or href
- [Django]-Django: Passing object from template to views
- [Django]-What may cause a Page Not Found error in flatpages?
Source:stackexchange.com