1

When I'm trying to change anything in my CSS files, I can't see any changes in the stylsheet shown to the browser.

After I build the project, I change a style (for example, the background color in default.css from white to black). I then run the project, but the page background still will be white. I think it comes from {% load static %} in my HTML template file, but I'm not quite sure. The only way I found to apply changes in CSS is to create new a CSS file and reference it from the HTML template. Any ideas how to fix it?

David Cain
  • 14,232
  • 11
  • 62
  • 68

2 Answers2

1

There are a couple things here that could be giving you issues.

  1. Your browser is caching the stylesheets. To disable this caching, you can open your developer tools, go the network tab, and click "Disable cache" (in Firefox or Chrome, at least).
  2. Your project is configured to serve the collected files. To fix this, run ./manage.py collectstatic - this will collect all your CSS into a single file, which can then be served.
Community
  • 1
  • 1
David Cain
  • 14,232
  • 11
  • 62
  • 68
0

sounds like caching is on on your browser. if you're using chrome, open dev tools and check the box to disable cache

https://stackoverflow.com/a/7000899/5360912

TinyTheBrontosaurus
  • 2,652
  • 5
  • 17
  • 32