Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As seen in the comment before, using Requestcontext solve your problem.</p> <p>Here is the documentation about csrf_token : <a href="https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it" rel="nofollow">https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it</a></p> <p>As we can read : </p> <blockquote> <p>Use RequestContext, which always uses 'django.core.context_processors.csrf' (no matter what your TEMPLATE_CONTEXT_PROCESSORS setting). <strong>If you are using generic views or contrib apps, you are covered already, since these apps use RequestContext throughout.</strong></p> </blockquote> <p>So here it seems we're not using a generic view, neither a contrib app. So what we need it to pass the RequestContext because it's like that csrf protection works in Django.</p> <pre><code>from django.core.context_processors import csrf from django.shortcuts import render_to_response def my_view(request): c = {} c.update(csrf(request)) # ... view code here return render_to_response("a_template.html", c) </code></pre> <p>or </p> <pre><code>from django.views.generic.simple import direct_to_template def app_view(request): return direct_to_template(request, 'app_template.html', app_data_dictionary) </code></pre> <p>or</p> <pre><code>from django.shortcuts import render_to_response from django.template import RequestContext def app_view(request): return render_to_response('app_template.html', app_data_dictionary, context_instance=RequestContext(request)) </code></pre> <p>Also the documentation speaks about : extras/csrf_migration_helper.py script. Seems to be helpful for your case :)</p> <p>Hope it helps ;)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload