title: Django - {% csrf_token %} was used in a template, but the context did not provide the value
body: <p>I'm new to Django and I'm still trying to get to grips with its features. I've created very simple project with <strong>Django 1.4.2</strong> which has index page with simple form where you enter something and results page where your input is displayed after submission (the code is below).</p>
  
  <p>After submission, I get error 403 and the following message:</p>
  
  <blockquote>
    <p>A {% csrf_token %} was used in a template, but the context did not
    provide the value.  This is usually caused by not using
    RequestContext.   warnings.warn("A {% csrf_token %} was used in a
    template, but the context did not provide the value.  This is usually
    caused by not using RequestContext.")</p>
  </blockquote>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;head&gt;
      &lt;title&gt;Index page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="header"&gt;Welcome to index page&lt;/div&gt;
      &lt;div id="content"&gt;
          &lt;p&gt;Enter your name&lt;/p&gt;
          &lt;form action="/result/" method="post" accept-charset="utf-8"&gt;{% csrf_token %}
              &lt;input type="text" name="answer"&gt;
              &lt;input type="submit" value="Send!"&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>result.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;head&gt;
      &lt;title&gt;Result page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="header"&gt;Here is the result&lt;/div&gt;
      &lt;div id="content"&gt;
          &lt;p&gt;Your name is: {{ answer }}&lt;/p&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>from django.http import HttpResponse
  from django.shortcuts import render_to_response
  from django.template import RequestContext
  
  def index(request):
      return render_to_response('index.html')
  
  def result(request):
      p = request.POST['answer']
      return render_to_response('result.html', {'answer': p}, context_instance=RequestContext(request))
  </code></pre>
  
  <p>I've looked into documentation and various examples on the Internet, but I don't understand what I'm doing wrong. If I disable <strong>django.middleware.csrf.CsrfViewMiddleware</strong> in <strong>settings.py</strong>, I get exactly what I want, but that's not the answer I'm looking for.</p>
  
  <p>I appreciate help from more experienced Django ninjas :-)</p>