Wednesday, April 5, 2017

Re: csrf verification failed when trying to upload profile pic after login...please help

Csrf verification is used for cross site request forgery protection. In earlier versions of django csrf_token was needed to be imported in views.py file. In latest releases, however, ( I am using django 1.10), no such thing is required. All you need to do is include {% csrf_token %} in your template inside form tag. 
Hope this helps. 

On Apr 6, 2017 2:59 AM, <greatlegend19@gmail.com> wrote:
when i try to upload profile pic after login through form..it shows csrf verification failed..
Any answers why this is happening ???

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3d13a000-7936-416a-83d5-a03b1a50e3da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BJxxxD3XcPADWxyc87COY1KUU7MSN4%2BqNfr9-ECTGs0SzQJ1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment