Bryan Head
Bryan Head

Reputation: 12580

CSRF verification failing for post or preview using {% render_comment_form for ... %}

I have django.middleware.csrf.CsrfViewMiddleware in settings.MIDDLEWARE_CLASSES and CSRF verification is working just fine for all my other forms. render_comment_form is including {% csrf_token %} properly; I verified that the HTML is showing up. Any ideas?

Upvotes: 0

Views: 196

Answers (1)

Bryan Head
Bryan Head

Reputation: 12580

I forgot to add

context_instance=RequestContext(request)

to my render_to_response call at the end of my view. Doh!

Upvotes: 1

Related Questions