Optimized collectstatic for S3ManifestStaticStorage
Project description
s3manifestcollectstatic
Optimized collectstatic for S3ManifestStaticStorage
Installation
- Install the package
pip install s3manifestcollectstatic
- Add
s3manifestcollectstatictoINSTALLED_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
You can limit the maximum number of workers using -w:
./manage.py s3manifestcollectstatic -w 4
Tested with:
- Python 3.9, Django 3.2, django-storages 1.11
- Python 3.11, Django 4.2, django-storages 1.13
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file s3manifestcollectstatic-0.3.2.tar.gz.
File metadata
- Download URL: s3manifestcollectstatic-0.3.2.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c742b07e36261e898db22bf031925053d7b0bfa17084783190e7fb6408cea59a
|
|
| MD5 |
51f4e4c02f38ef00a38993ea54c750d0
|
|
| BLAKE2b-256 |
bbc58291f5c1fd7fce0a7f9de0ec92663de1af58b580df69937e4e8021462010
|
File details
Details for the file s3manifestcollectstatic-0.3.2-py3-none-any.whl.
File metadata
- Download URL: s3manifestcollectstatic-0.3.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3850b5f226eddc949daa38a07fcede657e521afa2192e67fedfab08ab5a846e
|
|
| MD5 |
e74f113edecc99468eac215eebfe4d58
|
|
| BLAKE2b-256 |
4e81c09d2c97191f699e50d5970a7adc6509d704bf0add095e86c5947f5cdaed
|