I am using below code to add meta keywords -
in view.py
@template_render("mysite/category.html")
def category(request, slug):
slug = slug.lower()
product_type = local_settings.CATEGORY_NAME_TO_ID.get(slug, False)
if not product_type:
raise Http404
products = models.Product.objects.active().filter(product_type = product_type).all()
return { 'products' : products, 'slug' : slug, 'key':'wholesale ipad, ipad with retina display, ipad mini, ipad 3, ipad 2',}
And in template file -
{% extends "base.html"%}
{%load appletrade_tags%}
{% block key %}siteTrade - {{key}}{% endblock %}
{%block title%}site Trade - {{slug}}{%endblock%}
But it's not reflecting. I have checked in view source there is no keyword.
But Yes,title is reflecting.
Can you please help me to find out where I am wrong ?
EDIT :
base.html
{% extends "base.html"%}
{% block key %}{%if page.key%}{{page.key}}{%else%}{{block.super}}{%endif%}{% endblock %}
{% block desc %}{%if page.desc%}{{page.desc}}{%else%}{{block.super}}{%endif%}{% endblock %}
{%block title%}{%if page.title%}{{page.title}}{%else%}{{block.super}}{%endif%}{%endblock%}
{%block content%}
{%endblock%}