[Answer]-Django extends not including child file

1đź‘Ť

âś…

In your base.html block named content is appearing twice. You may want to name first block as title e.g. {% block title %}{% endblock %}

Django recommends that you shouldn’t define multiple template blocks with same name.

From Template inheritance

Finally, note that you can’t define multiple block tags with the same name in the same template. This limitation exists because a block tag works in “both” directions. That is, a block tag doesn’t just provide a hole to fill — it also defines the content that fills the hole in the parent. If there were two similarly-named block tags in a template, that template’s parent wouldn’t know which one of the blocks’ content to use.

👤Rohan

Leave a comment