django-resumable-uploads
is a multi-file resumable upload app. It uses plupload and jQuery in the backend.
- Django 1.11+
-
Add 'resumable_uploads' to your INSTALLED_APPS
-
Register urls in your root urlconf urls.py adding string to your urlpatterns like so :
# The url where the upload form is located: url(r'^$', 'resumable_uploads.views.upload'),
-
Specify the directory in which you would like to save the uploaded files. For example:
UPLOAD_ROOT = '/opt/project/media/uploads/
-
Link your model to the
ResumableFile
model:class MyModel(models.Model): file_uploads = models.ManyToManyField( 'resumable_uploads.ResumableFile' )
-
For any model form in which you would like to enable resumable uploads, use the
PlUploadFormField
. All the values in theoptions
dictionary will be passed to the PlUpload widget constructor:class FileUploadForm(models.ModelForm): class Meta: model = MyModel file_uploads = PlUploadFormField( path='uploads', label=_("Fichier"), options={ "max_file_size": '15000mb', "drop_element": 'drop_element', "container": 'drop_element', "browse_button": 'pickfiles' } )
For the full list of options that can be passed to PlUpload, please refer to:
http://www.plupload.com/docs/Options
- Make PlUploadFormField fully customizable
-
We use
tox
as a test runner. To run the tests, install tox on your system or in a virtual environment and run it in the root of the project:$ tox
- Consortium Érudit and contributors
Based on django-plupload by @vellonce
- All contributions are welcome. Please make sure the tests pass before submitting a pull request.
For any question, suggestion or additional help, feel free to contact dcormier
on Freenode.