Collectfasta

raw JSON →
3.3.3 verified Mon Apr 27 auth: no python

A faster collectstatic for Django, compatible with Django >=3.2 and Python >=3.10. Version 3.3.3 is the latest stable release. The project is actively maintained with frequent releases.

pip install collectfasta
error django.core.exceptions.ImproperlyConfigured: The COLLECTFASTA_STRATEGY setting must be a dotted path to a strategy class.
cause COLLECTFASTA_STRATEGY is not set or is incorrect.
fix
Set COLLECTFASTA_STRATEGY to a valid strategy path, e.g., 'collectfasta.strategies.filesystem.FileSystemStrategy'.
error TypeError: 'NoneType' object is not iterable
cause Possibly due to missing or misconfigured storage backend for static files.
fix
Ensure STORAGES['staticfiles'] is configured correctly with a proper BACKEND.
error AttributeError: module 'collectfasta' has no attribute 'Collectfasta'
cause Incorrect import or outdated version.
fix
Import correctly: from collectfasta import Collectfasta. Or upgrade: pip install --upgrade collectfasta.
breaking In version 3.3.0, the default strategy changed from the original single-pass to a two-pass strategy. If you rely on the old behavior, set COLLECTFASTA_STRATEGY to 'collectfasta.strategies.singlepass.SinglePassStrategy'.
fix Explicitly set COLLECTFASTA_STRATEGY in settings if you need the old single-pass strategy.
gotcha The MAX_ENTRIES cache setting must be set properly for the two-pass strategy. Incorrect values can cause excessive memory or I/O.
fix Ensure your cache backend's MAX_ENTRIES is set appropriately (e.g., for LocMemCache, default is 300; adjust based on your static file count).
deprecated The setting 'COLLECTFASTA_THREADS' is deprecated in favor of the strategy-specific configuration.
fix Use strategy parameters instead of global COLLECTFASTA_THREADS.

Basic setup: add collectfasta to INSTALLED_APPS and configure your static files storage.

# settings.py
INSTALLED_APPS = [
    # ...
    'collectfasta',
]

# For S3 (using django-storages)
STORAGES = {
    "default": {
        "BACKEND": "storages.backends.s3.S3Storage",
    },
    "staticfiles": {
        "BACKEND": "storages.backends.s3.S3Storage",
    },
}

# Optional: enable two-pass strategy for performance
COLLECTFASTA_STRATEGY = "collectfasta.strategies.filesystem.FileSystemStrategy"
# or use in-memory:
# COLLECTFASTA_STRATEGY = "collectfasta.strategies.memory.MemoryStrategy"