2

Issue

I recently connected my Django app to Digital Ocean Spaces using the django-storages library, and suffice it to say I have a lot of static files (currently 2545 files, most of which are small-ish audio files).

I just timed how long it took python3 manage.py collectstatic to run to copy a single static file, and it took 3 minutes 27 seconds. This was the output:

USER@computer dirName % python3 manage.py collectstatic

You have requested to collect static files at the destination
location as specified in your settings.

This will overwrite existing files!

Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes

1 static file copied, 2544 unmodified.

Question

Is there a way to speed the collectstatic process up? Can I tell it which files to collect and copy? Can it somehow interface with git to know which ones to collect and copy?

1 Answer 1

2

I would try using Collectfasta.

The issue is that collectstatic was originally built for use on the local disk, back before cloud storage was mainstream.

Jason Giancono, the author of Collectfasta, wrote a detailed article describing the issue.

1
  • 1
    Very nice. What used to take 3 minutes and 27 seconds now takes 8 seconds. It is indeed fasta
    – DevinG
    Commented Jul 9 at 22:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.