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

70 views
Skip to first unread message

greatl...@gmail.com

unread,
Apr 5, 2017, 5:29:44 PM4/5/17
to Django users
when i try to upload profile pic after login through form..it shows csrf verification failed..
Any answers why this is happening ???

Kriti Rohilla

unread,
Apr 5, 2017, 11:21:37 PM4/5/17
to django...@googlegroups.com
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, <greatl...@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...@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.
Reply all
Reply to author
Forward
0 new messages