0
votes

I just wanted to know that I am using the predefined registration module and it I am not able to validate the registration form. my registration_form.html look like this

{% extends "registration_base.html" %} 2 {% block title %} Registration Form {% endblock %} 3 {% block external %} 4 5 .error{ 6 color: red; 7 font-size: 14px; 8 } 9 1 {% extends "registration_base.html" %} 2 {% block title %} Registration Form {% endblock %} 3 {% block external %} 4 5 .error{ 6 color: red; 7 font-size: 14px; 8 } 9 10 {% endblock %} 11 {% block heading1 %}

Sign up for an account

{% endblock %} 12 {% block content %} 13 Use the form below to register for your new account; all fields are required. 14 {% csrf_token %} 15 {% if form.non_field_errors %} 16

{{ form.non_field_errors|join:"," }}

17 {% endif%} 18

{% if form.username.errors %} 19 {{ form.username.errors|join:"," }} 20 {% endif %} 21

22

Username: {{ form.username }} 23

24

{% if form.email.errors %} 25 {{ form.emails.errors|join:"," }} 26 {% endif %} 27

28

Your e-mail address: 29 {{ form.email }} 30

31

{% if form.password1.errors %} 32 {{ form.password1.errors|join:"," }} 33 {% endif %} 34

35

Password: 36 {{ form.password1 }} 37

38

{% if form.password2.errors %} 39 {{ form.password2.errors|join:"," }} 40 {% endif %} 41

42

ReType Password: 43 {{ form.password2 }} 44

45

46

47 {% endblock %}

Plese help me to figure out the problem. Thanks in advance.............

1
Sorry, not going to look at this until you tidy up your code. The instructions for formatting pasted code are shown on the right when you enter/edit your question: please read them.Daniel Roseman

1 Answers

0
votes

I worked out and got my answer that if we want to put any extra validations, then they should be inserted before the save method of the form. Its the correct place to perform the task. Hope this would help a beginner like me.