#19021: collectstatic should only copy files if they have changed or don't
exist in
destination
-------------------------------+-------------------------
Reporter: dloewenherz | Owner: dloewenherz
Type: New feature | Status: new
Component: Uncategorized | Version: 1.4
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-------------------------
When running `./manage.py collectstatic`, all files in all static
directories are copied to the location specified by `STATICFILES_STORAGE`,
regardless of whether they have already been copied or not.
I propose that collectstatic should only copy files to the destination if
they have changed or don't yet exist. I wrote my own solution which
doesn't incorporate staticfiles, but I'd like to see this in Django
proper. Without this feature, it can take ages to upload static media for
a large project. It makes sense to only update those assets which have
changed between deploys.
I currently solve this problem by creating a file containing metadata of
all the static media at the root of the destination. This file is a JSON
object that contains file paths as keys and checksum as values. When an
upload is started, the uploader checks to see if the file path exists as a
key in the dictionary. If it does, it checks to see if the checksums have
changed. If they haven't changed, the uploader skips the file. At the end
of the upload, the checksum file is updated on the destination.
--
Ticket URL: <https://code.djangoproject.com/ticket/19021>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.