Django not showing updated css files

[亡魂溺海] 提交于 2020-12-05 14:42:30

问题


So I'm using sass to update my Django site and I am using git to version the whole thing. I recently made an update to CSS file that had some bad errors in it. Sass compiled the changes and I pushed the new version to the server. I have looked on the server and the new css file is in fact there and reflects the changes, however when I look at our site the css file is being referenced as a cached file:

"/static/CACHE/css/35ed7f45f0e3.css"

Unfortunatley this cached version still has the errors in it, how can I tell django and memcache to refresh this reference so my site doesn't look like poop?

I have tried clearing the cache via the shell but the old cached file reference persists in my html.


回答1:


Did you run collectstatic ?

python manage.py collectstatic 



回答2:


2020

If python manage.py collectstatic solution doesn't work and everything is correct in your code.
Press ctr + F5 in your browser to bypass the cache.

Then it will work hopefully.



来源:https://stackoverflow.com/questions/20576318/django-not-showing-updated-css-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!