Hi, folks! I'm new to Django, now I'm writing my first e-commerce in it, and now I'm having a mistake that I can not find in code myself. Please help me..
The code is the following:
The trouble URL code line : url(r'^(?P<category_slug>[-/w]+)/$', views.category, name = 'category_detail'),
The view code : def category(request, category_slug):
c = get_object_or_404(Category, category_slug = category_slug)
products = c.product_set.all()
page_title = c.category_name
meta_keywords = c.category_meta_keywords
meta_description = c.category_meta_description
return render(request, 'categories/category.html', locals())
Thanks for your help in advance..
-- The code is the following:
The trouble URL code line : url(r'^(?P<category_slug>[-/w]+)/$', views.category, name = 'category_detail'),
The view code : def category(request, category_slug):
c = get_object_or_404(Category, category_slug = category_slug)
products = c.product_set.all()
page_title = c.category_name
meta_keywords = c.category_meta_keywords
meta_description = c.category_meta_description
return render(request, 'categories/category.html', locals())
Thanks for your help in advance..
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3866fec2-4497-48c9-9f83-86f98c0143cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment