I'm looking for some pointers to implementing a file upload progress bar that gives feedback about the current status of the upload of a FileField inside a ModelForm.
My ModelForm has got a lot of fields (not only FileField) and I would like to show a live feedback of the progress with a progress bar.
Thanks.
Here is my solution to the problem: django-smartfields, this app can take care of reporting progress, convert images or videos, clean up old files and more. It has some requirements for progress reporting:
I am working on documentation for django-smartfields right now, but this portion of the app is still not documented, but here is how you would use it.
Now in
forms.py
:Nothing special needs to be done in the views.py, except that
'file_form'
should be in the context. Make suresmartfields
are inINSTALLED_APPS
andurls
haveurl(r'^smartfields/', include('smartfields.urls', namespace='smartfields')),
in them or you can create a customized upload view, by extendingsmartfields.views.FielUpload
.In the template:
Let me know if you have any questions or if it doesn't work for some reason. Make sure you use version from github, javascript file on pypi is outdated.