Django ajax file upload problem csrf
I'm trying to do a ajax file upload using django. I am trying to make this example work
http://www.johnberns.com/2010/07/08/using-valums-jquery-ajax-upload-with-django-1-2/
开发者_开发技巧But strangely I keep getting "None" for my csrf token and even more strange is that I am doing the POST call sending the file but all I get on the server is just the following dict:
{u'csrfmiddlewaretoken': [u'None']}
What am I doing wrong?
The whole premise of that linked article is wrong. You don't need to worry about the CSRF token - CSRF protection is automatically disabled for Ajax uploads, since there is no way of making it work reliably. See the documentation.
精彩评论