Skip to main content

Parallel file copying for Django's collectstatic.

Project description

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.S3StaticStorage'
DEFAULT_FILE_STORAGE = 'collectfaster.backends.S3MediaStorage'

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

Credits

Tools used in rendering this package:

History

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.

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

django-collectfaster-0.1.1.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file django-collectfaster-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django-collectfaster-0.1.1.tar.gz
Algorithm Hash digest
SHA256 26f5a670226dbfdcec2222ac3ec0ed5b8e029ac8f44e56b83aeed69827a1ebde
MD5 0cfa0d603dbe24fa86a7612138747304
BLAKE2b-256 bd11b8df30c004f503f1bf7ba1d0a4c2f6f7f0f2a8a40a16b12ed663efd42dd5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page