title: Why is my CSRF token failing in Django?
body: <p>I've provided CSRF in <code>views.py</code> and included <code>csrf_token</code> in templates, but still search is not working due to “csrf_token failure”. </p>
  
  <p>My <code>views.py</code> code is: </p>
  
  <pre><code>args = {}
  args.update(csrf(request))
  args['articles']= Article.objects.all()
  args['lang'] = language
  args['session_language']=session_language
  return render_to_response('articles.html', args)
  </code></pre>
  
  <p>and template code is</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;h3&gt;Search&lt;/h3&gt;
  {% csrf_token %}
  &lt;input type='text' id='search' name='search' /&gt;
  </code></pre>