Django不反映更新到Javascript文件? [英] Django Not Reflecting Updates to Javascript Files?

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

问题描述

我的静态文件夹中有javascript文件。 Django发现并加载它们完全正常,所以我不认为配置 static 选项有什么问题。但是,有时候,当我更改一个 .js 文件并保存它时,使用它的Django模板不反映这些更改 - 使用浏览器检查JavaScript最后一个保存前的javascript。重新启动服务器什么都不做,但重新启动计算机有时解决了这个问题。我没有明确处理缓存的代码。有没有人经历过这样的事情?

I have javascript files in my static folder. Django finds and loads them perfectly fine, so I don't think there is anything wrong with my configuration of the static options. However, sometimes when I make a change to a .js file and save it, the Django template that uses it does NOT reflect those changes -- inspecting the javascript with the browser reveals the javascript BEFORE the last save. Restarting the server does nothing, though restarting my computer has sometimes solved the issue. I do not have any code that explicitly deals with caching. Has anyone ever experienced anything like this?

推荐答案

我相信您的浏览器正在缓存您的js

I believe your browser is caching your js

电源刷新您的浏览器,或清除浏览器缓存?

you could power refresh your browser, or clear browser cache?

Chrome控件+ f5或shift + f5

on chrome control+f5 or shift + f5

相信它是控制+ shift + r

i believe on firefox it is control + shift + r

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

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