Is it possible in Django to make nested templates like this:
base.html
{% block content %}{% endblock %}
Nested1.html
{% extends "base.html" %}
{% block content %}
{% block content1 %}{% endblock1 %}
{% endblock %}
OR
Nested1.html
{% extends "base.html" %}
{% block content %}{% endblock %}
{% block content1 %}{% endblock1 %}
Nested2.html
{% extends "Nested1.html" %}
{% block content1 %}{% endblock1 %}
The docs for this are here: The Django template language | Django documentation | Django
I’ll just point out that there is no tag “endblock1”. The tag name is “endblock”.
Oh, sorry, of course it’s ‘endblock’
If I try to nest it like I described, I got Exception Value:
Invalid block tag on line 3: ‘content’. Did you forget to register or load this tag?
on the Nested2
What do the current/ corrected templates look like that you are trying?
Oh that was my mistake, everything nesting like it should