Django不显示更新的css文件 [英] Django not showing updated css files

查看:49
本文介绍了Django不显示更新的css文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在使用sass更新我的Django网站,并且正在使用git对整个版本进行版本控制.我最近对CSS文件进行了更新,发现其中有一些错误.Sass编译了更改,然后将新版本推送到服务器.我查看了服务器,实际上新的css文件在那里并反映了更改,但是,当我查看我们的站点时,css文件被引用为缓存文件:

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"

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

不幸的是,此缓存版本仍然存在错误,如何告诉django和memcache刷新此引用,以使我的网站看起来不像便便?

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?

我尝试通过外壳清除缓存,但是旧的缓存文件引用仍保留在我的html中.

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

推荐答案

您是否运行了collectstatic?

Did you run collectstatic ?

python manage.py collectstatic 

这篇关于Django不显示更新的css文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆