Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make 'collectstatic' find updated files

Is there a way to make python manage.py collectstatic find updated static files? Currently, it is properly searching STATICFILES_DIRS and finding where I have my static files, but it only uploads new ones. If I modify a static file, it does not detect this. Does Django do this so we have to delete each file first, or is there an easy solution?

like image 823
Joker Avatar asked Sep 01 '25 17:09

Joker


1 Answers

UPDATE:

Disclaimer - This issue has to do with external hosting on Amazon's S3 Storage

I had simply forgot to include AWS_PRELOAD_METADATA = True in my settings.py file. Adding this setting in fixed the issue of collectstatic only finding new files. Also, I saw a major speed increase in syncing between the server and Amazon's S3.

If you are using S3 for storage, I found this answer to be quite helpful.

like image 65
Joker Avatar answered Sep 04 '25 12:09

Joker