1

I know this might be a really obvious question, but I'm doing a Django project where I have Javascript in my static files. However, I have noticed that whenever I make a change to those files, my web server doesn't reflect the changes. Is there some migration or something else I need to do to make my web server reflect changes to my static Javascript files? Thanks.

M-Chen-3
  • 2,036
  • 5
  • 13
  • 34

1 Answers1

1

You might want to run python manage.py collectstatic on the webserver to put the static files in the correct folder. https://docs.djangoproject.com/en/3.1/howto/static-files/

Another possible issue is caching. You could use ManifestStaticFilesStorage https://docs.djangoproject.com/en/3.1/ref/contrib/staticfiles/#manifeststaticfilesstorage to have new filenames whenever a file is updated and escape cache issues.

edgars
  • 1,038
  • 1
  • 7
  • 17