title: "CSRF token missing or incorrect"
body: <p><strong>EDIT SOLVED</strong>: I feel like such a moron. I originally created two separate views: one for input and one for output. I had been handling all of the code here in the output view even though I rearranged my url and template to just reuse the input view... SORRY EVERYONE. It works fine now...</p>
  
  <hr>
  
  <p>I'm running on localhost, and when I submit my form I'm getting a "CSRF token missing" error. I've read the documentation and some stackoverflows. I have already solved most of the common issues:</p>
  
  <ul>
  <li>I have the csrf token in my template (when loaded the template has inserted exactly this: <code>&lt;input type="hidden" name="csrfmiddlewaretoken" value=""&gt;</code>)</li>
  <li>I am using render_to_response with <code>render_to_response('_template_',{_data_:'_data_'},context_instance=RequestContext(request))</code></li>
  <li>I do have have RequestContext imported to my views</li>
  <li>I do have <code>'django.middleware.csrf.CsrfViewMiddleware'</code> in my settings.</li>
  </ul>
  
  <p>Anyone have any idea what I could be missing?</p>
  
  <p>Here is my form:</p>
  
  <pre><code>&lt;form action="" method="post"&gt;
              {% csrf_token %}
              &lt;input type="text" name="q"&gt;
              &lt;input type="submit" value = "Submit"&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>Here is my view:</p>
  
  <pre><code>def view_workout(request):
      errors = []
      if request.method == 'POST':
          q = request.POST['q']
          if not request.POST.get('q', ''):
              errors.append('Please complete all required fields')
              return render_to_response('swimsets/view_workout.html',{
                  'error': errors
              },context_instance=RequestContext(request))
          else:
              return render_to_response('swimsets/view_workout.html',{
                  'query': q
              },context_instance=RequestContext(request))
  
      else:
  
          return render_to_response('swimsets/view_workout.html', {
  
      },context_instance=RequestContext(request))
  </code></pre>
  
  <p>Here is my settings:</p>
  
  <pre><code>MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  )
  </code></pre>