Django включает шаблон в качестве переменной для использования по умолчанию
Я хотел бы включить шаблон по умолчанию в качестве переменной, чтобы передать его в случай по умолчанию, как показано ниже:
<div class="row max-h-200 overflow-hidden">
{% include 'blog/userprofile_deleted.html' as deleted_profile %}
{{ user.profile.bio | safe | default:deleted_profile }}
</div>
Возможно ли это в django 3.2.9 ?
В настоящее время я должен выписать текст по умолчанию в виде html в одной строке:
<div class="row max-h-200 overflow-hidden">
{{ user.profile.bio | safe | default:'<h4> Very long html string! </h4> <span>Comment as <b>you</b> with your own profile!</span><span>Create your Account at the <a href="#footer">bottom of the page</a>,or by visiting <a href="{% url "register" %}"><code>/register</code></a> !</span>' }}
</div>