# pip install validators
>>> import validators
>>> validators.url("https://google.com")
True
>>> validators.url("https://google"):
False
from django.core.validators import URLValidator()
validate = URLValidator()
try:
validate("http://www.avalidurl.com/")
print("String is a valid URL")
except ValidationError as exception:
print("String is not valid URL")