Here I need to add an extra confirmation password in my form.I used Django\'s modelform. I also need to validate both passwords. It must raise a validation error if
confirmation password
def clean(self): cleaned_data = super(UserAccountForm, self).clean() password = cleaned_data.get("password") confirm_password = cleaned_data.get("confirm_password") if password != confirm_password: self.add_error('confirm_password', "Password does not match") return cleaned_data