title: Django: CSRF token missing or incorrect
body: <p>The error is at location <a href="http://127.0.0.1:8000/fileupload/form.py" rel="noreferrer">http://127.0.0.1:8000/fileupload/form.py</a></p>
  
  <p>I have version 1.3 of django. I have tried specifying localhost:8000 as stated in someone else's question but this did not work for me.  I am trying to have a file upload form but I am receiving an error that form.py does not have the CSRF token.</p>
  
  <p>form.py:</p>
  
  <pre><code>class UploadFileForm(forms.Form):
  
      title = forms.CharField(max_length=50)
      file  = forms.FileField()
  </code></pre>
  
  <p>views.py:</p>
  
  <pre><code>def upload_file(request):
  
      c = {}
      c.update(csrf(request))
  
      if (not request.user.is_authenticated()) or (request.user == None):
        return HttpResponseRedirect("/?error=11")
  
  
      if request.method == 'POST':
        form = c['UploadFileForm'] = UploadFileForm(request.POST, request.FILES,  c, context_instance=RequestContext(request))
  
        if c['UploadFileForm'].is_valid():
          handle_uploaded_file(request.FILES['file'])
          return HttpResponseRedirect('/success/url/')
  
      else:
          form = c['UploadFileForm'] = UploadFileForm()
      return render_to_response('fileupload/upload.html', {'form': c['UploadFileForm']})
  </code></pre>
  
  <p>upload.html:</p>
  
  <pre><code>{% block main_content %}
  
  
    &lt;form action="fileupload/form.py" enctype="multipart/form-data" method="POST"&gt;
      {% csrf_token %}
      &lt;table&gt;
  
        &lt;tr&gt;&lt;td&gt;Title:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="title" /&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;File:&lt;/td&gt;&lt;td&gt;&lt;input type="file" name="file" /&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;/table&gt;
        &lt;input type="submit" value="Submit" class = "float_right button_input" /&gt;
  
    &lt;/form&gt; 
  
  {% endblock main_content %}
  </code></pre>
  
  <p>I am very stumped please tell me some things to try. Thank You</p>