from django.core.validators import URLValidator
from django.core.exceptions import ValidationError
val = URLValidator(verify_exists=False)
try:
    val('http://www.google.com')
except ValidationError as e:
    print(e)
Python - How to validate a url in python ? (Malformed or not)