Skip to content

erudit/django-resumable-uploads

Repository files navigation

Build Status Coverage

django-resumable-uploads

django-resumable-uploads is a multi-file resumable upload app. It uses plupload and jQuery in the backend.

Requirements

  • Django 1.11+

Getting started

  1. Add 'resumable_uploads' to your INSTALLED_APPS

  2. 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'),
  3. Specify the directory in which you would like to save the uploaded files. For example:

    UPLOAD_ROOT = '/opt/project/media/uploads/
  4. Link your model to the ResumableFile model:

    class MyModel(models.Model):
    
        file_uploads = models.ManyToManyField(
            'resumable_uploads.ResumableFile'
        )
  5. For any model form in which you would like to enable resumable uploads, use the PlUploadFormField. All the values in the options 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

Roadmap

  • Make PlUploadFormField fully customizable

Running the tests

  • 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

Authors

Based on django-plupload by @vellonce

Contributing

  • 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.