0

So when you make changes to your CSS or JS static file and run the server, sometimes what happens is that the browser skips the static file you updated and loads the page using its cache memory, how to avoid this problem?

  • Does this answer your question? [CSS changes are not getting reflected. Why?](https://stackoverflow.com/questions/28235731/css-changes-are-not-getting-reflected-why) – Ivan Starostin Apr 23 '20 at 09:58
  • @Ivan Starostin That post doesn't really have clarity, I added this to support beginners so they don't get overwhelmed or lost going through this problem. Thanks –  Apr 25 '20 at 14:38

2 Answers2

0

Well there are multiple ways to avoid this problem

  1. the simplest way is by:

    • if you are using Mac: Command+Option+R
    • if you are using Windows: Ctrl+F5

What it does is that it re-downloads the cache files enabling the update of the static files in the browser.

  1. Another way is by:

    • making a new static file and pasting the existing code of the previously used static file and then running the server

What happens, in this case, is that the browser doesn't use the cache memory for rendering the page as it assumes it is a different file.

0

U have DEBUG = False in your settings.py. Switch on DEBUG = True and have fun