Answer the question
In order to leave comments, you need to log in
Wrapper around block in Django template?
Good evening.
In the parent template, you need to insert a wrapper around the block defined in the child template, but if this block is not defined, then you do not need to insert a wrapper ( ). How can this be implemented? base.html:<div class="card stacked">...</div>
{% block content %}
...
<div class="card stacked">
<div class="card-body">
{% block account_form %}{% endblock %}
</div>
</div>
...
{% endblock %}
{% extends "account/base.html" %}
{% block account_form %}
<form ...>
{% endblock %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question