Django Context Syntax -
i getting syntax error in context:
'meta_description':meta_description
the arrow points the colon.
here view gives me error:
django.shortcuts import render, get_object_or_404 .models import category, menuitem def show_category(request, category_slug): c = get_object_or_404(category, slug=category_slug) menuitems = c.product_set.all() template_name="menu/category.html" page_title = c.name meta_keywords = c.meta_keywords meta_description = c.meta_description context = { 'c':c, 'menuitems':menuitems, 'page_title':page_title, 'meta_keywords':meta_keywords 'meta_description':meta_description } return render(request, template_name, context)
what causing this? thanks
you forgot , after meta_keywords
context = { 'c':c, 'menuitems':menuitems, 'page_title':page_title, 'meta_keywords':meta_keywords, 'meta_description':meta_description }
Comments
Post a Comment