Django Block Title Shows In Page Content

Viewed 416

I was trying to add a title for one of my Django HTML templates. The title of the website changes but it also shows up as text on the page content. How do I fix this and why does this happen?

base.html

{% block head %}
<head>
    <title>{% block title %}{% endblock %}</title>
</head>
{% endblock %}

page.html

{% extends "base.html" %}
{% block head %}
{% block title %}Some Title{% endblock %}
{% endblock %}
2 Answers

You don't need to use head block just use title block

{% extends "base.html" %}
{% block title %}Some Title{% endblock %}
Related