📅  最后修改于: 2022-03-11 14:45:15.686000             🧑  作者: Mango
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")