我不认为你可以从包含的模板中替换块。我的建议是,你需要重新思考你的模板的逻辑。恕我直言,它应该是这样的:
base.html文件
{% block title %}{% endblock %}{% block content %}
{% block navigation %}
{% if perms.staffing.add_staffrequest %}
href="/create/staffrequest/">Staff Request
{% endif %}
{% endblock %}
{% block real_content %}
Hello, {{ user.first_name }}.
Please create a Staff Request here by filling out the form below.
{% endblock %}
{% endblock %}
{% block footer %}{% endblock %}
和你home.html的应该像
{% extends "base.html" %}
{% block title %}Home Portal{% endblock %}
{% block home %}current{% endblock %}
{% block real_content %}
Hello, {{ user.first_name }}.
Please create a Staff Request here by filling out the form
below.
{% endblock %}