djangodjango-templatesdjango-staticfilesdjango-storagedjango-static

ManifestStaticFilesStorage - still fetching old static file even when staticfiles.json shows the right mapping


I am using using ManifestStaticFilesStorage. After performing collectstatic and moving over the files to prod, I still see old css file (with old MD5 hash string) being fetched.

settings.py:

STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'

On prod, I can see staticfiles.json showing the correct (new) css file but still when I do 'view-source' from the web page, I can see old css being fetched.

What could I have missed?


Solution

  • Restart Django on prod after moving the files over.

    (I don't know why that's required but thats the only thing that works)


    Update (Aug 2022): I ran into the same problem after 5 years and bumped into my own post. This time restarting Django also did not help. But restarting Nginx helped (got the hint from @patrickm96's answer) - in case it helps