title: a series of form posts with django results in 403 error
body: <p>if the user clicks submits a form on the landing page it takes them to a another page (second page) but if the user then tries to login on the second page via another form post the user receives a 403 forbidden error. </p>
  
  <p>landing page form works.
  login form works fine.
  but submitting landing page form then login form results in 403 CSRF verification failed.</p>
  
  <p>The form on the first page returns:</p>
  
  <pre><code>render(request, 'page.html', context_var)
  </code></pre>
  
  <p>The form void of css looks like:</p>
  
  <pre><code>&lt;form action="{% url 'url_test' %}" method="POST"&gt;
  &lt;input type="hidden" name="some_name" value="for_view_use"&gt;
  {% csrf_token %}
  &lt;button type="submit" name="other_name" value="value"&gt;button&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The second form or the view which allows the user to login returns:</p>
  
  <pre><code>HttpResponse('success')
  </code></pre>
  
  <p>and the login form void of css is:</p>
  
  <pre><code>&lt;form action="{% url 'login' %}" method="post"&gt;
  {% csrf_token %}
  &lt;input type="text" name="username"&gt;
  &lt;input type="password" name="password"&gt;
  &lt;button type="submit"&gt;Sign In&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I am sure both these views return these values as I have tested them separately.</p>
  
  <p>I have tried using <code>@csrf_protect</code> but that hasn't worked. I've checked and the token is present on the second page when loaded. I know it's something to do with the csrf token but I can't figure it out.</p>
  
  <p>to me it looks as if the first form isn't returning an acceptable csrf token for the next page.</p>
  
  <p>EDIT:
  I did not solve the problem itself but I noticed the first request was just pulling data from the server so I changed it to a GET request and the bug stopped happening. This is not an answer in my opinion so I will leave this thread open in case someone else is having trouble with consecutive form POST requests with django.</p>