I was just thinking…

block.super

July 2, 2007 · Leave a Comment

This ended up resolving a bug for on Satchmo, but I hadn’t been aware of it prior to this.

In Django you can allow one template to inherit another one, keeping the original content and appending new content in the child template (or sub-template).

{% block sidebar %}

{{ block.super }}

… new content …

{% endblock %}

Read more about template inheritance in Django here.

Categories: Linux · Linux Programming · Programming · Python · django

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment