Collectfast dramatically speeds up Django's `collectstatic` command when using cloud storage by only uploading static files that have changed. It leverages MD5 hashes (ETags) or modification times to determine if a file needs to be re-uploaded. The current version is 2.2.0, with a release cadence of a few times per year, focusing on compatibility and performance improvements.
pip install collectfastVerified import paths — ran on the pinned version, not inferred.
To quickly set up `collectfast`, add it to your `INSTALLED_APPS` and configure the necessary settings in your Django `settings.py`. Ensure `COLLECTFAST_ENABLED` is `True` and, crucially, set `COLLECTFAST_STRATEGY` to match your static files storage backend. This example shows configuration for AWS S3 using `django-storages`.
Upgrade Python to 3.6+ and Django to 2.0+. If using S3, ensure `django-storages` is configured with `S3Boto3Storage` and `COLLECTFAST_STRATEGY` is set to `collectfast.strategies.aws.S3Strategy`.
Add `COLLECTFAST_STRATEGY = 'collectfast.strategies.aws.S3Strategy'` (or other relevant strategy, e.g., `collectfast.strategies.filesystem.FileSystemStrategy`) to your `settings.py`.
Migrate to `collectfast.strategies.aws.S3Strategy` (for `boto3`) and ensure `django-storages` is configured with `S3Boto3Storage`.
Upgrade `collectfast` to 2.2.0 or later to ensure consistent gzip compression levels for S3.