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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -