title: Django file upload failure
body: <p>I'm quiet new to django.I have met a problem when I tryied to write a page handling the uploading files.Here are the codes:</p>
  
  <h1>models.py:</h1>
  
  <pre><code>   class HomeworkContent(models.Model):
          homework = models.ForeignKey(Homework, related_name="content_homework")
          student = models.ForeignKey(User, related_name="content_student")
          grade = models.IntegerField(blank = True, default = -1)
          description = models.CharField(blank = True, max_length = 1000)
          file = models.FileField(upload_to='file/%Y/%m/%d', blank=True,null=True)
  </code></pre>
  
  <h1>view.py:</h1>
  
  <pre><code>@login_required
  def submit_homework(request, course_id, assignment_id):
      user  = request.user
      form = HomeworkContentForm(request.POST, request.FILES)
      if request.method == 'POST':
          if form.is_valid():
              content = HomeworkContent()
              content.file = request.FILES['file']
              content.description = form.cleaned_data["description"]
              content.save()
              return render_to_response('assignment_detail.html', locals(),  RequestContext(request))
      else:
          form = HomeworkContentForm()
      return render_to_response('assignment_submit.html',locals(), RequestContext(request))
  </code></pre>
  
  <h1>html:</h1>
  
  <pre><code>  &lt;form enctype="multipart/form-data" method="post" action=""&gt;
    {% csrf_token %}
    &lt;table&gt;
      &lt;tr&gt;&lt;th&gt;&lt;label for="id_description"&gt;description:&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input id="id_description" maxlength="1000"          name="description" type="text" /&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;th&gt;&lt;label for="id_file"&gt;File:&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input id="id_file" name="file" type="file" /&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;/table&gt;
    &lt;input id="submit" type="submit" value="submit" /&gt;
  
    &lt;/form&gt;
  </code></pre>
  
  <h1>forms.py</h1>
  
  <pre><code>class HomeworkContentForm(forms.Form):
      description = forms.CharField(label = u'description', required = False, max_length = 1000)
      file = forms.FileField()
  </code></pre>
  
  <p>So what is the problem? I would appreciate it very much if someone could help me.</p>