Open tamarmot opened 7 years ago
Ah -- I correct myself. When I manually tell django-resumable to init my field, I move on to the next issue.
Here is how I can init my field:
var el = $('input#id_sourceFile'); dj.initField(el[0]);
and now resumable.js is failing in the getTarget method.
I was running into this problem while testing django-resumable. The data-upload-url attribute was not being rendered for the ResumableFileField form field so the DjangoResumable JS class would not work. After some digging, I found out that the ResumableFileInput widget was purging the set data-upload-url attr due to a bad build_attrs call. One minor change to ResumableFileInput.render was enough to fix the problem (widgets.py#L47).
attrs = self.build_attrs(self.attrs, attrs)
https://github.com/jeanphix/django-resumable/blob/dev/resumable/widgets.py#L47
Someone had fixed the problem in a fork but I didn't find that changed version until after I figured it out on my end.
https://github.com/xtranophilist/django-resumable/commit/a49f4bf7ea45ab4a8456999a716937f6779b990a
After upgrading to django 1.11 and bootstrap4 alpha, my django-resumable is no longer getting initialized properly. In the constructor, I see that it is searching for inputs with a name equal to data-upload-url, but there are no such elements. When I tried to manually search for my input field button to call initField, that also does not seem to work.
This system used to work perfectly for us; we have everything correct in terms of installation, installed apps, including javascript files etc. I've also tried pip-installing your latest code from github but no joy.
I'm thinking there is an issue with how the template is getting generated. I'm using form.as_p, and the generated html is:
Any suggestions? Thanks.