0

Im currently working on a project and I want to make a nice looking login screen with django and bootstrap 3.

Atm I have this code:

{% extends "base.html" %}
{% load bootstrap3 %}
{% block content %}

<div class="row"><div class="col-md-4">
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}

<form role="form" method="post" action="">
   {% csrf_token %}
<div class="form-group">
   {% bootstrap_field form.username %}
</div>
<div class="form-group">
   {% bootstrap_field form.password %}
</div>
<input type="hidden" name="next" value="{{ next }}" />
   {% bootstrap_form_buttons %}
      <button type="submit" class="btn btn-primary">Login</button>
   {% end_bootstrap_form_buttons %}
</form>
</div></div>
{% endblock %}

Which results in the following error: Invalid block tag on line 20: 'bootstrap_form_buttons', expected 'endblock'. Did you forget to register or load this tag?

According to me I have bootstrap3 loaded and I have looked on google but can't seem to find the problem. Please help.

1 Answer 1

1

django-bootstrap3 does not have a templatetag called bootstrap_form_buttons. You probably want to use buttons or bootstrap_button

Change your code to this:

{% buttons %}
    <button type="submit" class="btn btn-primary">Login</button>
{% endbuttons %}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.