I am trying to use validators in my form fields but am getting an error:
from django import forms
from django.db import models
from django.core.exceptions import ValidationError
class Register(forms.Form):
username = forms.CharField(max_length=100,label="Username",validators=[validate_email])
>>>> name 'validate_email' is not defined
I have tried this with a number of different validator types, only to be hit with the same message for each. I have looked over the documentation and really can't see what I am missing as to how to import the validators into the class, any advice is appreciated