@register.filter
def prepend_http_if_necessary(value):
 parsed = urlparse(value)
 if (not parsed.scheme):
  return ('http://' + parsed.geturl())
 return value

@ register . filter def prepend_http_if_necessary ( value ) : parsed = urlparse ( value ) if ( not parsed . scheme ) : return ( 'http://' + parsed . geturl ( ) ) return value
if someone makes "www .