Thursday, July 19, 2012

Re: CSRF token not adding hidden form field

Thanks .. I had the same problems and it worked too.

On Saturday, June 12, 2010 4:54:34 AM UTC-3, Joel Klabo wrote:
I finally got it to work by adding the RequestContext to my
render_to_response. I think the issue was that it was redirecting and
the csrf_token wasn't getting sent to the new page by the
requestcontext, here is what it looks like now: (csrf_token is also in
the form)

return render_to_response('profile.html', {'drinks' : drinks,
'followers' : followers},
                                                        context_instance=RequestContext(request))

Thanks for all the help!

On Jun 11, 9:32 pm, Ali Kusnadi <kugutsu.hir...@gmail.com> wrote:
> On 6/11/10, Joel Klabo <joelkl...@gmail.com> wrote:
>
> > yeah, still 403. CSRF token missing or incorrect.
>
> try add the  'django.core.context_processors.csrf' in your settings.py
>
> TEMPLATE_CONTEXT_PROCESSORS = (
>
>         'django.core.context_processors.csrf',
>
> )
>
>
>
>
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/joM94dB4hVgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment