def validate(self, value, model_instance):
        super(URLField, self).validate(value, model_instance)
        if self.empty(value):
            return
        parsed = urlparse(value)
        if not all((parsed.scheme, parsed.hostname)):
            raise ValidationError('invalid_url', self)
        if self.schemes and parsed.scheme.lower() not in self.schemes:
            schemes = ', '.join(self.schemes)
            raise ValidationError('invalid_scheme', self, schemes=schemes)
dataset/ETHPy150Open bendavis78/python-gitmodel/gitmodel/fields.py/URLField.validate/original