Skip to main content

A Django app for the uploading of large files from the django admin site.

Project description

django-resumable-async-upload

django-resumable-async-upload is a django app to allow you to upload large files from within the django admin site asynchronously, that means that you can add any number of files on the admin page (e.g. through inline models) and continue editing other fields while files are uploading.

  • Currently only tested with the Django default file storage

Installation

  • pip install django-resumable-async-upload
  • Add django_resumable_async_upload to your INSTALLED_APPS
  • Add re_path(r"^django_resumable_async_upload/", include("django_resumable_async_upload.urls")), to your urls.py
  • Add in your models field
from django_resumable_async_upload.models import AsyncFileField

class Foo(models.Model):
    bar = models.CharField(max_length=200)
    foo = AsyncFileField()
  • Add in your admin form:
from django_resumable_async_upload.fields import FormResumableMultipleFileField
from django_resumable_async_upload.widgets import ResumableAdminWidget

class MultiUploadForm(forms.ModelForm):
    files = FormResumableMultipleFileField(
        required=False,
        widget=ResumableAdminWidget(attrs={"model": File, "field_name": "file"}),
    )

Optional Settings:

  • Set ADMIN_RESUMABLE_CHUNKSIZE, default is "1*1024*1024"
  • Set ADMIN_RESUMABLE_STORAGE, default is setting of storages and ultimately 'django.core.files.storage.FileSystemStorage'. If you don't want the default FileSystemStorage behaviour of creating new files on the server with filenames appended with _1, _2, etc for consecutive uploads of the same file, then you could use this to set your storage class to something like https://djangosnippets.org/snippets/976/
  • Set ADMIN_RESUMABLE_CHUNK_STORAGE, default is 'django.core.files.storage.FileSystemStorage' . If you don't want the default FileSystemStorage behaviour of creating new files on the server with filenames appended with _1, _2, etc for consecutive uploads of the same file, then you could use this to set your storage class to something like https://djangosnippets.org/snippets/976/
  • Set ADMIN_RESUMABLE_SHOW_THUMB, default is False. Shows a thumbnail next to the "Currently:" link.
  • Set ADMIN_SIMULTANEOUS_UPLOADS to limit number of simultaneous uploads, defaults to 3. If you have broken pipe issues in local development environment, set this value to 1.
  • Set MEDIA_URL to where images are stored to be rendered after upload

Optional Param for AsyncFileField

  • max_files, default is None. Configure how many files are allowed to be uploaded to a file input.

Versions

0.1.0 - inital fork of django-async-upload 4.0.1 with support for Django 4 and later. Includes admin form updates to pause, resume, cancel and track progress of upload. Also supports uploads of multiple files

Compatibility

Tested on Django 4.2 running on python 3.12

Thanks to

original django-admin-resumable-js by jonatron https://github.com/jonatron/django-admin-resumable-js

django-admin-resumable-js fork by roxel https://github.com/roxel/django-admin-resumable-js

django-admin-async-upload fork by DataGreed https://github.com/DataGreed/django-admin-async-upload

django-async-upload fork by bit https://github.com/bit/django-async-upload

Resumable.js https://github.com/23/resumable.js

Typescript supported version of resumable.js https://github.com/augustcodes08/resumable-uploads

django-resumable https://github.com/jeanphix/django-resumable

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_resumable_async_upload-0.1.4.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_resumable_async_upload-0.1.4-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file django_resumable_async_upload-0.1.4.tar.gz.

File metadata

  • Download URL: django_resumable_async_upload-0.1.4.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_resumable_async_upload-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7ede0d80d3b449f301751b448add548ac85683958e7bc5e17cdde2e9b5b2b9b7
MD5 fa8b3d47f3e27451e9ee26873995dd12
BLAKE2b-256 6b0d61223999a017b7cab7fbc7f1fa425a6107b33fd20cc62ad1d5d6e57e138d

See more details on using hashes here.

File details

Details for the file django_resumable_async_upload-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: django_resumable_async_upload-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_resumable_async_upload-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 246cc4ccc3eef97f12000609051e42349cf1dc90f6de6551941de7d6161f82cf
MD5 14ddc2bc5155aadd330cb2f25232313c
BLAKE2b-256 880e42f10b446d42775ee57a4d6450e339d86e2fd86c9bf4a079fd6521ef0cbb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page