[Fixed]-Changes made to (static) CSS file not reflecting in Django development server

26👍

If you develop locally using Django’s server there’s no need to use the collectstatic command, it is only meant to collect all static dependencies to a single access point where you can point your ‘real’ server to, e.g. apache, lighttpd, nginx etc.

As for your problem, you insinuate it ‘magically’ fixes it self after a few days. Have you tried resetting your browser’s cache?

8👍

In my case, my browser was caching the Js and CSS files and thus I was unable to see the changes.
You can try hard refreshing the page

For chrome/chromium browsers:
Ctrl + F5 or Ctrl + Shift + R
both works for me.

3👍

Do a Hard Refresh in Browser
Firefox:
    Window, Linux: 1.] ctrl + F5 2.] Ctrl + Shift + R
    Mac 1.] Command + Shift + R
Chrome:
    Window, Linux: 1.] ctrl + F5 2.] Ctrl + usual refresh
    Mac 1.] Command + Shift + R 2.] Ctrl + usual refresh
Safari:
    Mac 1.] Shift + Command + R

2👍

clearing cache worked for me.
after deleting it 2 times, changes are displayed by just refresh button

2👍

just try hard refreshing the page
For chrome/chromium browsers:

Ctrl + Shift + R

it’s done!

0👍

Use incognito mode to test the changes, as the normal window will keep saving your changes in cache which is not the case with incognito window.

0👍

If its not updating the css you changed. first make sure you are making changes in static file directory.
After making that changes run command python manage.py collectstatic
and then runserver.

Make sure to refresh browser by ctrl and f5.
Hopefully it will works. peace

0👍

(1)Simply I first remove CSS file from static folder and after that I refresh Server.

(2)After that my template did not reflect any CSS to my html page

(3) After that I simply restore my same name edited css file in static folder and it work properly .

(4) After that your CSS is not run properly than you should add this directory in settings.py

STATICFILES_DIRS = [
    os.path.join(BASE_DIR,'static'),
              ]

*If not your CSS not apply just check your all link code should be

Leave a comment