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

I am trying to use the django-bootstrap3 package with my project.

I created my template as follows:

{% 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 %} 

But I get

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

Error.

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

are in the base.html file.

+6
source share
1 answer

You must load {% load bootstrap3 %} inside your template.

 {% 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 %} 
+13
source

Source: https://habr.com/ru/post/982704/


All Articles