Reputation: 365
I am working on a django project, but for some reason the template I am using brings up an invalid block tag error. I have looked at some other similar questions, but nothing seems helpful, so if you can see the problem please do tell me.Here is the template:
{% extends "learning_logs/base.html" %}
{% load bootstrap3 %}
{% block header %}
<h2>Register an account.</h2>
{% endblock header %}
{% block content %}
<form method="post" action="{% url 'users:register' %}" class="form">
{% csrf_token %}
{% bootstrap-form form %}
{% buttons %}
<button name="sumbit" class="btn btn-primary">register</button>
{% endbuttons %}
<input type="hidden" name="next" value="{% url 'learning_logs:index' %}" />
</form>
{% endblock content %}
Thanks,
Milo
Upvotes: 4
Views: 4057
Reputation: 11
Also for everyone else that have this same error and it's not a typo like OP did, make sure you have loaded bootstrap in your child template via
{% extends "base.html" %}
{% load bootstrapX %}
Where X is your version of bootstrap , So it's not sufficent to load it in the base template.In addition to that make sure the load bootstrap statment is after the extends
statment, This video explains the setup in great detail https://www.youtube.com/watch?v=YmJ0TACm8oE
Upvotes: 1
Reputation: 2260
{% bootstrap-form form %}
should be {% bootstrap_form form %}
. Also paste the error
Upvotes: 1