Changes made to a (static) CSS file that is not reflected on the Django development server

I am building a web application using Django and am experiencing certain problems getting changes made in the CSS file (which is stored in the static directory of my application) to reflect it on the development server.

To be clear, the server has access to static files, however it is currently stuck on the old iteration of my CSS file. A similar problem occurred a few weeks ago when any changes I made to the CSS file did not appear. This problem was fixed in a few days.

However, not getting immediate visual feedback is extremely difficult. I tried all of the following to fix the problem:

  • My DEBUG is set to "True"
  • I provided STATIC_URL
  • I tried to "collect" static files. The command worked, but the dev server still does not reflect the changes made to the CSS file
  • I provided STATIC_ROOT, STATICFILES_DIR and STATICFILES_FINDER. They are currently commented out because I realized that some of them are only for production or not needed for development.

My static resources are stored in the "static" directory of one of my applications - "post_it_gen", which is part of the project. According to the documentation, this should automatically search for Django.

Any new suggestions are welcome.

+7
css django
source share
1 answer

If you are developing locally using the Django server, there is no need to use the collectstatic command, it is only intended to collect all static dependencies into a single access point, where you can specify your "real" server, for example, apache, lighttpd, nginx, etc. .d.

As for your problem, you are hinting that it "magically" fixes it on its own in a few days. Have you tried resetting your browser cache?

+8
source share

All Articles