title: django 1.6 automatically remove or add http:// from URLField from form data
body: <p>I am going through the Tango With Django tutorials, I have come across a function in the forms chapter ( <a href="http://www.tangowithdjango.com/book/chapters/forms.html" rel="nofollow">http://www.tangowithdjango.com/book/chapters/forms.html</a> ) that I cannot get to work.</p>
  
  <p>Admittedly I am going through the tutorial using Python 3.3 and Django 1.6, however so far I've been able to move through the tutorials.</p>
  
  <p>The <code>clean</code> function <code>forms.py</code> is supposed to clean the URLField:</p>
  
  <pre><code>class PageForm(forms.ModelForm):
      title = forms.CharField(max_length=128, help_text="input page title")
      url = forms.URLField(max_length=200, help_text="input page URL")
      views = forms.IntegerField(widget=forms.HiddenInput(), initial=0)
  
      def clean(self, cleaned_data):
          cleaned_data = super(PageForm, self).clean()
          url = cleaned_data.get('url')
  
          if url and not url.startswith('http://'):
              url = 'http://' + url
              cleaned_data['url'] = url
  
          return cleaned_data
  
      class Meta:
          model = Page
          fields = ('title', 'url', 'views')
  </code></pre>
  
  <p>Here is an excerpt from the <code>add_page.html</code> template:</p>
  
  <pre><code>&lt;form id="page_form" method="POST" action="/rango/category/{{category_name_url}}/add_page/"&gt;
  
          {% csrf_token %}
          {% for hidden in form.hidden_fields %}
              {{ hidden }}
          {% endfor %}
  
          {% for field in form.visible_fields %}
          &lt;p&gt;&lt;/p&gt;
              {{ field.errors }}
              {{ field.help_text }}
              {{ field }}
          {% endfor %}
  
          &lt;p&gt;&lt;/p&gt;
          &lt;input type="submit" name="submit" value="create page" /&gt;
          &lt;br&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>As a workaround I have adjusted the <code>forms.py</code> <code>url</code> function to work this way per the official Django docs, although it is not my preferred method:</p>
  
  <pre><code>url = forms.URLField(
      max_length=200, help_text="input page URL", initial='http://')
  </code></pre>