picsellia-s3manifestcollectstatic
This is a fork of https://github.com/dduong42/s3manifestcollectstatic
Optimized collectstatic for S3ManifestStaticStorage. With max_workers parameters and custom handler of exception while uploading files
Installation
- Install the package
pip install picsellia-s3manifestcollectstatic
- Add
picsellias3manifestcollectstatictoINSTALLED_APPS
Description
collectstatic can take a long time. When used with
storages.backends.s3boto3.S3ManifestStaticStorage, collectstatic uploads
the files twice, once without the hash at the end of the file name, and once
with the hash. Also, it doesn't use multiple threads to upload to s3.
s3manifestcollectstatic uploads the files only once, uses threads to speed
things up, and doesn't upload the files that are already on S3.
collectstatic: (Around 20 minutes)
$ time ./manage.py collectstatic --noinput
604 static files copied, 646 post-processed.
./manage.py collectstatic --noinput 29,94s user 2,27s system 2% cpu 20:25,06 total
s3manifestcollectstatic: (Around 30 seconds)
$ time ./manage.py s3manifestcollectstatic
604 static files copied to '/tmp/tmpbw0q_5lq', 646 post-processed.
Start the upload of 604 files
Uploading the manifest
./manage.py s3manifestcollectstatic 10,95s user 1,92s system 49% cpu 26,269 total
If you want to reupload the files use -f:
./manage.py s3manifestcollectstatic -f
Tested with Python 3.9, Django 3.2, django-storages 1.11
Metadata
Release files for picsellia-collectstatic 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| picsellia_collectstatic-0.0.4.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| picsellia_collectstatic-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.8 kB
Release files / picsellia_collectstatic-0.0.4.tar.gz
| Download URL | picsellia_collectstatic-0.0.4.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efd6a8e496d12b500adf0a8b6693ef4123b6a0e77cec6aa05436f501c83c1390
|
|
BLAKE2b-256 checksum How to use checksums |
fc931e3f8b4149c64d40d5365ac290cfb2d65766794ecd641a2d3fe4f5123ce9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.3 Linux/6.2.0-33-generic
|
Release files / picsellia_collectstatic-0.0.4-py3-none-any.whl
| Download URL | picsellia_collectstatic-0.0.4-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04ed43ae060c25e45ab8d33dd5470d1dee8400afb0358d30cace4992eaf7b7b0
|
|
BLAKE2b-256 checksum How to use checksums |
e4afb3c3d4392fbee68df31f9376dc049a72c7c88a8d6e2a3ba9f186a5c28436
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.3 Linux/6.2.0-33-generic
|