title: CSRF token missing or incorrect (I know, its been asked before!)
body: <p>Been two days trolling through Google, stackoverflow, and docs.djangoproject.com for a solution to CSRF problems.</p>
  
  <p><b>Disclaimer, am a beginner at Django and following along the book <i>The definitive guide to django - web development done right.</i> Well, apparently am getting something wrong  :-( </b></p>
  
  <p>See below one such attempt and see if you can point out any mistakes because I've tried all the suggestions on stackoverflow but no luck as yet:</p>
  
  <p><b><i>view.py:</i></b></p>
  
  <pre><code>from django.shortcuts import render_to_response
  from django.template import RequestContext
  
  def add_vehicle(request):
      return render_to_response('vehicle.html', RequestContext(request, {}))
  </code></pre>
  
  <p><b><i>vehicle.html:</i></b></p>
  
  <pre><code>{% extends "base.html" %}
  {% block title %}Vehicle Registration{% endblock %}
  {% block content %}
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;form action="/vehicle/" method="post"&gt; {% csrf_token %}
      &lt;table width=100%&gt;
          &lt;tr&gt;
              &lt;td&gt;Reg #:&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="regnumber"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Model:&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="model"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Manufacturer:&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="manufacturer"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Year:&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="year"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;       
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Chassis #:&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="chasisnumber"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;       
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="submit" value="Submit"&gt;
              &lt;input type="submit" value="Clear"&gt;
              &lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;       
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  {% endblock %}
  </code></pre>
  
  <p><i>I hope that's not too much code for stackoverflow.</i></p>
  
  <p>Now, I keep getting the <b><i>CSRF token missing or incorrect</i></b>.</p>
  
  <p>Please assist.</p>
  
  <p><strong>Edit (Adding details on error)</strong></p>
  
  <p><i>settings.py looks like this:</i></p>
  
  <pre><code>MIDDLEWARE_CLASSES = (
  'django.middleware.common.CommonMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  )
  </code></pre>
  
  <p>Here is what the console displays when I open vehicle.html page:</p>
  
  <pre><code>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.")
  </code></pre>