[Answered ]-Django customising template for form

1👍

You are using a formwizard and it seems that you are missing the wizard management formdata in your html form.

{% block content %}

  <form method="post">
    {% csrf_token %}
    <!-- A formwizard needs this form -->
    {{ wizard.management_form }}


    {% for field in form %}
      <p>
        {{ field.label_tag }}<br>
        {{ field }}
        {% if field.help_text %}
          <small style="color: grey">{{ field.help_text }}</small>
        {% endif %}
        {% for error in field.errors %}
          <p style="color: red">{{ error }}</p>
        {% endfor %}
      </p>
    {% endfor %}
    <button type="submit">Sign up</button>
    <a href="{% url 'login' %}">Log In</a>
  </form>
  
{% endblock %}

Here you check more: https://django-formtools.readthedocs.io/en/latest/wizard.html#creating-templates-for-the-forms

Leave a comment