django - How to validate a url field whether the website url is valid format or not in forms.py and shows the error in template -
i using django class based views. trying validate url field in forms.py file. check whether given url valid format or not , return errors in template page. can me this.
def clean_website(self): website = self.cleaned_data.get("website") val = urlvalidators(verify_exists=false) val(website)
it's not working me.please 1 me validate field , return error.
thanks in advance.
try returning data @ end of method:
return val(website)
Comments
Post a Comment