Sef*_*efa 6 python django python-2.7
我正在尝试在我的项目中使用django-bootstrap3包.
我已经构建了这样的模板:
{% extends "base.html" %}
{% block content %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{% bootstrap_icon "star" %} All customers</h3>
</div>
<div class="panel-body">
All your customers are listed here in alphabetical order. In this panel you can update and delete
your customer informations.
</div>
</div>
{{ customers }}
{% endblock %}
Run Code Online (Sandbox Code Playgroud)
但我得到了
无效的块标记:'bootstrap_icon',预期'endblock'
错误.
{% load bootstrap3 %}
{% bootstrap_css %}
{% bootstrap_javascript %}
Run Code Online (Sandbox Code Playgroud)
在base.html文件中.
RéÑ*_*ïth 13
您应该{% load bootstrap3 %}在模板中加载 .
{% extends "base.html" %}
{% load bootstrap3 %}
{% block content %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{% bootstrap_icon "star" %} All customers</h3>
</div>
<div class="panel-body">
All your customers are listed here in alphabetical order. In this panel you can update and delete
your customer informations.
</div>
</div>
{{ customers }}
{% endblock %}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2182 次 |
| 最近记录: |