title: Django Form not validating even with values filled
body: <p>This is my first Django project and I am having trouble picking up the value in my form. I have created an UploadFileForm, implemented some basic code in the Views, and mapped the urls in the urls.py. My problem is occurring when I try to send input to my form. Even though my form is filled, it is giving me an error saying the fields are not filled. I have narrowed down my problem to the 'form.is_valid' function. Is there something I am missing in my code?</p>
  
  <p>upload.html</p>
  
  <pre><code>&lt;form action="{% url 'upload_file' %}" method="post"&gt;
      {% csrf_token %}
      {{ form.as_p }}
      {{ form.errors }}
      {{ form.non_field_errors }}
      &lt;input type="submit" value="OK"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>form.py</p>
  
  <pre><code>from django import forms
  
  class UploadFileForm(forms.Form):
      title = forms.CharField(max_length=50)
      file = forms.FileField()
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>from django.shortcuts import render
  from django.http import HttpResponseRedirect
  from .forms import UploadFileForm
  
  def success(request):
      return render(request, 'success.html')
  
  def upload_file(request):
      if request.method == 'POST':
          form = UploadFileForm(request.POST, request.FILES)
          if form.is_valid():
              handle_uploaded_file(request.FILES['file'])
              return HttpResponseRedirect('success/')
      else:
          form = UploadFileForm()
      return render(request, 'upload.html', {'form': form})
  
  def handle_uploaded_file(f):
      with open('uploaded.txt', 'wb+') as destination:
          for chunk in f.chunks():
              destination.write(chunk)
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>from django.conf.urls import url
  from django.views.generic import TemplateView
  from . import views
  
  urlpatterns = [
      url(r'^$', views.index, name='index'),
      url(r'^upload/success/', views.success, name='success'),
      url(r'^upload/$', views.upload_file, name='upload_file'),
  ]
  </code></pre>