【发布时间】:2025-12-22 23:25:15
【问题描述】:
我正在使用 Django 1.9 和演示模板结构来显示 home.html。 我在 base.html 文件中包含以下内容:
{% block bootstrap3_content %}
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
...
</div>
</nav>
<div class="container-fluid">
{% autoescape off %}{% bootstrap_messages %}{% endautoescape %}
{% block content %}(no content){% endblock %}
</div>
{% endblock %}
导航栏显示成功,但我没有在下面的容器中收到引导消息? 我是 Django 和这个应用程序的新用户。请帮忙!
编辑1:
bootstrap.html 扩展 bootstrap3.html; base.html 扩展 bootstrap.html; home.html 扩展 base.html。
主页.html
{% block title %}My_title{% endblock %}
{% block content %} This is <em>bootstrap3</em> for <strong>Django</strong>.
{% endblock %}
我在导航栏中得到标题,但content 块内没有消息。
【问题讨论】:
标签: django twitter-bootstrap-3 django-templates