2015-02-18 14 views
6

Sto provando a utilizzare il pacchetto django-bootstrap3 con il mio progetto.Tag di blocco non valido: 'bootstrap_icon', atteso 'endblock'

ho costruito il mio modello come questo:

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

Ma sto ottenendo

tag blocco non valido: 'bootstrap_icon', atteso 'endblock'

errore.

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

Sono nel file base.html.

risposta

13

È necessario caricare {% load bootstrap3 %} all'interno del modello.

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