Optimized collectstatic for S3ManifestStaticStorage
Project description
s3manifestcollectstatic
Optimized collectstatic for S3ManifestStaticStorage
Installation
- Install the package
pip install s3manifestcollectstatic
- Add
s3manifestcollectstatic
toINSTALLED_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
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
Hashes for s3manifestcollectstatic-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62ae8f904f587dea753524e8b7031f05631f10451b3ed6d5cd49f872ab1e6de6 |
|
MD5 | 5975e888f726bf4cd569e9cfb383d0f2 |
|
BLAKE2b-256 | 0adee88485d0756bfb2c367daf81efa3b0560e07f773ecbd43c079a12c8bba63 |
Hashes for s3manifestcollectstatic-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 570d854d7eecd136946da236ebf149a1c72b7d0888f609f1e0622860f6fb8089 |
|
MD5 | 8936f630a844e4caf51037eb67108fba |
|
BLAKE2b-256 | 57213c02c49783f3bc2ce96ab2d8a9aa4b76dbbc4d57baaf582b18f4c001d53f |