13👍
✅
OK, it’s a bug in Django’s template system. For most other cases, Ben James is right (see his comment to my question above).
In my case, the child
block was inside a {% ifnotequal a b %}
block, and that breaks the block inheritance. I consider that to be a bug, since there are dozens of natural use cases for such operations.
-1👍
Do this:
{% extends "master.html" %}
{% block parent %}
{% block child %}
New content here...
{% endblock child%}
{% endblock parent %}
- [Django]-How to get an ImageField URL within a template?
- [Django]-Token Authentication for RESTful API: should the token be periodically changed?
- [Django]-Format numbers in django templates
Source:stackexchange.com