{% extends 'app/base.html' %} {% load static %} {% block title %} Registration
{% endblock title %} {% block content %}

<div class="container">
  <div class="row my-3">
    <div class="text-center fw-bold"><h1>Customer Registration</h1></div>
    <hr />

    {% if form.non_field_error %} {% for error in form_non_field_error %}
    <p class="alert alert-danger my-3">{{error}}</p>
    {% endfor %} {% endif %} {% if messages %} {% for msg in messages %}
    <div class="alert alert-{{msg.tags}}" role="alert">{{msg}}</div>
    {% endfor %} {% endif %}

    <form action="" method="post" novalidate class="shadow p-5">
      {% csrf_token %} {% for fm in form %} {{ fm.label_tag }} {{fm}}
      <small class="text-danger">{{fm.errors|striptags}}</small>
      <br />
      {% endfor %}
      <input type="submit" value="Submit" class="btn btn-primary" />
      <br />

      <div class="text-center text-primary fw-bold">
        <small
          >Already have account ?
          <a href="{% url 'login' %}" class="text-danger">Login Now</a></small        >
      </div>

      {% if form.non_field_errors %}
        {% for error in form.non_field_errors %}
          <p class="alert alert-danger my-3">{{error}}</p>
        {% endfor %}
      {% endif %}
      
    </form>
  </div>
</div>
{% endblock content %}
