gpt4 book ai didi

python - 无效的 block 标记 : 'bootstrap_icon' , 预期 'endblock'

转载 作者:太空狗 更新时间:2023-10-29 22:11:07 26 4
gpt4 key购买 nike

我正在尝试使用 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 %}

但是我得到了

Invalid block tag: 'bootstrap_icon', expected 'endblock'

错误。

{% load bootstrap3 %}
{% bootstrap_css %}
{% bootstrap_javascript %}

在 base.html 文件中。

最佳答案

您应该在模板中加载 {% 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 %}

关于python - 无效的 block 标记 : 'bootstrap_icon' , 预期 'endblock',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28590149/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com