def validate_username_not_url(username):
 if (username.startswith('http://') or username.startswith('https://')):
  raise ValidationError(_('This field requires an identifier, not a URL.'))
 return username

def validate_username_not_url ( username ) : if ( username . startswith ( 'http://' ) or username . startswith ( 'https://' ) ) : raise ValidationError ( _ ( 'This field requires an identifier, not a URL.' ) ) return username
validate that a username is not a url .