[Answer]-Junk text along side html due to django template blocks?

1👍

You’ve put the definition of the heading_style block in the child within the content block. So it’s being used for two things: as text content within content, and to fill the heading_style block in the parent.

Move heading_style outside of the content block definition, and it should be fine.

0👍

one endblock is missing

{% block content %} 
{{block.super}}
{% block heading_style %}Login{% endblock %} {% endblock %}

0👍

I’m not sure overriding a block and nested sub-block along with {{block.super}} is good combination of doing things. May be you want to re-factor your templates for not relying on this.

Here is a ticket on django related to this (not sure this has been fixed or not) {{ block.super }} doesn’t work with nested {% block %} statements

👤Rohan

Leave a comment