Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0ca379d
update resumablejs
paigewilliams Jan 9, 2026
8b5a269
display percent uploading in UI
paigewilliams Jan 9, 2026
ece7e20
rename package
paigewilliams Jan 9, 2026
8e4c010
add middleware and admin mixin to track and delete file
paigewilliams Jan 12, 2026
6f76b72
add tests for middleware
paigewilliams Jan 12, 2026
c4aae87
allow for specific GET requests in form before clearing session
paigewilliams Jan 12, 2026
2de7fb0
comment out broken tests; add requirements.txt
paigewilliams Jan 12, 2026
f271f2c
include pause/resume and cancel buttons
paigewilliams Jan 13, 2026
70f404f
support multiple uploads with max_files param
paigewilliams Jan 20, 2026
7c55a05
track multiple files in session
paigewilliams Jan 20, 2026
0879cf3
allow for deleting uploaded file
paigewilliams Jan 20, 2026
98c2099
fix removing orphaned file on multiple chunked upload
paigewilliams Jan 21, 2026
975c235
display thumbnails for media and bulk media uploads
paigewilliams Jan 21, 2026
854ff04
fix selenium test
paigewilliams Jan 21, 2026
8f75d8a
use chrome for selenium test; make test less flaky
paigewilliams Jan 22, 2026
311e17f
cancel all button works
paigewilliams Jan 23, 2026
54121c8
add test for cancelling single file upload
paigewilliams Jan 23, 2026
8ffd1ce
add test for cancelling all uploads
paigewilliams Jan 23, 2026
1eb1836
add test for pause/resume buttons
paigewilliams Jan 23, 2026
e5ba99b
verify progress bar with pause/resume
paigewilliams Jan 23, 2026
c2cd65c
add test for error state on upload
paigewilliams Jan 23, 2026
8d355f3
add test for multiple file uploads
paigewilliams Jan 23, 2026
462e2f6
fix tests
paigewilliams Jan 23, 2026
f6c32a0
use css classes instead of inline styles
paigewilliams Jan 23, 2026
c5d7acf
use storages instead of DEFAULT_FILE_STORAGE to resolve django warnings
paigewilliams Jan 23, 2026
d14d8df
allow for configurable chunk folder
paigewilliams Jan 24, 2026
440b474
add docs
paigewilliams Jan 26, 2026
631779f
fix readme and setup.py issues
paigewilliams Jan 27, 2026
d0ccc26
make tests less flaky
paigewilliams Jan 27, 2026
003e90b
remove middleware and mixin
paigewilliams Jan 27, 2026
2354789
formatting, logging fix
paigewilliams Jan 27, 2026
bf47ea1
add deconstruct method to AsyncFileField
paigewilliams Jan 27, 2026
213f82f
add tests for storages
paigewilliams Jan 28, 2026
0dfce28
remove unused import
paigewilliams Jan 28, 2026
60f7082
add FormResumableMultipleFileField to use allow_multiple_selected att…
paigewilliams Jan 28, 2026
0d7497d
cleaner error handling in UploadView.delete
paigewilliams Jan 28, 2026
57b14bc
clean up tests
paigewilliams Jan 28, 2026
fc963e1
use tuple in exception
paigewilliams Jan 28, 2026
bb51201
use escapejs when accessing MEDIA_URL
paigewilliams Jan 28, 2026
b96793b
add switch case for form_class in AsyncFileField depending on max_fil…
paigewilliams Jan 28, 2026
d7f021c
always use RormResumableFileField in AsyncFileField
paigewilliams Jan 28, 2026
3ab1ea8
wip: github action to run tests
paigewilliams Jan 28, 2026
ddb06fe
install requirements.txt in gh action
paigewilliams Jan 28, 2026
e0ec5df
add wait for clickable element in tests
paigewilliams Jan 28, 2026
ba1aa08
try adding chrome and chromedriver to gh action
paigewilliams Jan 28, 2026
43d5ece
try installing chrome via apt-get
paigewilliams Jan 28, 2026
6fbd322
keep waiting for button
paigewilliams Jan 28, 2026
773878c
try larger file for pause/resume test
paigewilliams Jan 28, 2026
c88ab6d
Revert "try larger file for pause/resume test"
paigewilliams Jan 28, 2026
28367a6
ignore test_upload.py in gh action
paigewilliams Jan 29, 2026
0280f68
fix typo
paigewilliams Jan 29, 2026
bdd2496
try playwright
paigewilliams Jan 29, 2026
41db358
declare file_path out of try/except
paigewilliams Jan 29, 2026
a6a2b8c
apply ruff format
paigewilliams Jan 29, 2026
ae18dae
initalize package with uv
paigewilliams Jan 29, 2026
9eb5341
bump versions
paigewilliams Jan 29, 2026
31b45b9
fix urls and file paths
paigewilliams Jan 30, 2026
35e9bd6
use python version 3.11
paigewilliams Jan 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run Tests

on: [push, pull_request]

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install Playwright browsers
run: python -m playwright install --with-deps chromium

- name: Run tests

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to get selenium tests to work and didnt seem like worth the effort. If time allows, it might be worth looking into using something like playwright instead considering they have better docs on how to run in a GH action https://playwright.dev/python/docs/ci-intro

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copilot was EXTREMELY helpful in migrating to playwright! wooooo

run: pytest --tracing=retain-on-failure

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-traces
path: test-results/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# django-resumable-async-upload

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

markdown > rst


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
58 changes: 0 additions & 58 deletions README.rst

This file was deleted.

14 changes: 0 additions & 14 deletions admin_async_upload/fields.py

This file was deleted.

15 changes: 0 additions & 15 deletions admin_async_upload/models.py

This file was deleted.

49 changes: 0 additions & 49 deletions admin_async_upload/storage.py

This file was deleted.

Loading
Loading