Skip to main content

Latest Version Downloads

This package extends Django’s collectstatic management command with a --faster argument that activates the parallel file copying. The speed improvement is especially helpful for remote storage backends like S3.

Quickstart

Install django-collectfaster:

pip install django-collectfaster

Configure installed apps in your settings.py and make sure collectfaster is listed before django.contrib.staticfiles:

INSTALLED_APPS = (
    ...,
    'collectfaster',
    'django.contrib.staticfiles',
    'storages',
    ...,
)

If you are using S3 with django-storages you probably already have this configured in your settings.py:

AWS_S3_HOST = 's3-eu-west-1.amazonaws.com'
AWS_STORAGE_BUCKET_NAME = '<your_aws_bucket_name>'

Set the storage backends for your static and media files in the settings.py:

STATICFILES_STORAGE = 'collectfaster.backends.boto.S3StaticStorage'
DEFAULT_FILE_STORAGE = 'collectfaster.backends.boto.S3MediaStorage'
# STATICFILES_STORAGE = 'collectfaster.backends.boto3.S3Boto3StaticStorage'
# DEFAULT_FILE_STORAGE = 'collectfaster.backends.boto3.S3Boto3MediaStorage'

You should split your static and media files on your S3 in different folders and configure it in the settings.py:

STATICFILES_LOCATION = 'static'
MEDIAFILES_LOCATION = 'media'

Set the STATIC_URL at least on your production settings:

STATIC_URL = 'https://%s/%s/%s/' % (AWS_S3_HOST, AWS_STORAGE_BUCKET_NAME, STATICFILES_LOCATION)

Usage

Collect your static files parallel:

python manage.py collectstatic --faster

Set the amount of workers to 30:

python manage.py collectstatic --faster --workers=30

Spawn workers using multiprocessing instead of gevent:

python manage.py collectstatic --faster --use-multiprocessing

Credits

Tools used in rendering this package:

History

0.1.2 (2017-04-07)

  • Add support for boto3 and multiprocessing instead of gevent

  • Moved backends to a submodule (please change your setting variables STATICFILES_STORAGE and DEFAULT_FILE_STORAGE)

0.1.1 (2016-08-08)

  • Rather use django-storages than the deprecated fork from django-storages-redux.

0.1.0 (2016-05-19)

  • First release on PyPI.

Metadata

Release files for django-collectfaster 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-collectfaster 0.1.3
File Size Uploaded
django-collectfaster-0.1.3.tar.gz 7.7 kB Details

Release files / django-collectfaster-0.1.3.tar.gz

Download URL django-collectfaster-0.1.3.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
92fe44b383f6204591db87c3748c58eed5ea0df782d55773a97045bd10c224b7
BLAKE2b-256 checksum
How to use checksums
910a2d225f48b98c42604b9f839a0d6affafce077e6ab59f20304277638bc91d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.3 This release

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page