title: Why does my Django form keep saying "this field is required"
body: <p>Does anyone know why my form (filepicker) is constantly returning "this field is required" when it worked in a simpler version?</p>
  
  <p>My view is</p>
  
  <pre><code>def add_attempt(request, m_id, a_id):
      template = loader.get_template('add_attempt.html')
      if request.method == 'POST':
          import pprint 
          pprint.pprint(request.POST)
          pprint.pprint(request.FILES)
          form = UploadAttemptForm(data=request.POST, files=request.FILES)
          if form.is_valid():
              form.instance.pub_date = datetime.datetime.now()
              form.instance.user_id = request.user
              form.instance.assignment = m.Assignment.objects.get(id=a_id)
              form.save()
              return HttpResponseRedirect(reverse('assignment', args=(m_id, a_id)))
          else:
              print form.errors
      else:
          form = UploadAttemptForm()
      context = RequestContext(request, 
          {
          'form':form,
          })
      return HttpResponse(template.render(context))
  </code></pre>
  
  <p>My Model is</p>
  
  <pre><code>class Attempt(models.Model):
      user_id = models.ForeignKey(User)
      pdf_filename = models.FileField(storage=settings.S3_STORAGE, upload_to='pdfs')
      pub_date = models.DateTimeField('date uploaded')
      assignment = models.ForeignKey(Assignment)
  </code></pre>
  
  <p>And my form is</p>
  
  <pre><code>class UploadAttemptForm(forms.ModelForm):
      def __init__(self, *args, **kwargs):
          super(UploadAttemptForm, self).__init__(*args, **kwargs)
  
      class Meta():
          model = Attempt
          fields = ['pdf_filename',]
  </code></pre>
  
  <p>The error prints out as </p>
  
  <pre><code>`&lt;QueryDict: {u'submit': [u'Upload Attempt'], u'pdf_filename': [u'something.pdf']}&gt;`
  </code></pre>
  
  <p><code>&lt;MultiValueDict: {}&gt;</code>
      <code>&lt;ul class="errorlist"&gt;&lt;li&gt;pdf_filename&lt;ul class="errorlist"&gt;&lt;li&gt;This field is required.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;</code></p>