sigurdga / django-jquery-file-upload

A minimal django project containing a minimal app with a working jquery file upload form based on the work by Sebastian Tschan: http://aquantum-demo.appspot.com/file-upload
MIT License
579 stars 187 forks source link

csrf.js and cookie.js #66

Open kuyucakli opened 7 years ago

kuyucakli commented 7 years ago

Hi, In static/js folder there is a csrf.js ( for ajax ). But I couldn't find the line you are calling it, in the template files. And why cookie.js is needed ? ( there is no comment line for this )?

When I add cookie.js I get error:

jquery.min.js:2 jQuery.Deferred exception: $.cookie is not a function TypeError: $.cookie is not a function at HTMLDocument. (http://127.0.0.1:8000/admin/media_library/media/?:467:28) at j (http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:29999) at k (http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:30313) undefined

Thank you very much...

sigurdga commented 6 years ago
$ grep -ri csrf.js                 
fileupload/templates/fileupload/picture_angular_form.html:<script src="/static/js/csrf.js"></script>
fileupload/templates/fileupload/picture_form.html:<script src="/static/js/csrf.js"></script>
fileupload/templates/fileupload/picture_jquery_form.html:<script src="/static/js/csrf.js"></script>
$ grep -ri cookie.js 
fileupload/templates/fileupload/picture_basicplus_form.html:<script src="/static/js/jquery.cookie.js"></script>
fileupload/templates/fileupload/picture_basic_form.html:<script src="/static/js/jquery.cookie.js"></script>

These files are added in the upstream project: https://github.com/blueimp/jQuery-File-Upload and I haven't looked into the details for this project. I was just impressed by the upstream example and wanted similar functionality in my Django projects.

BTW: I'm very sorry for this very late reply.