【Error】django-debug-toolbar不显示:Failed to load module script
正确安装和配置
参照官方文档正确进行安装和配置:Installation — Django Debug Toolbar 6.0.0 documentation
问题
运行项目,django-debug-toolbar 没有显示,打开网页控制台,出现错误:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
解决方法
-
打开注册表编辑器
-
输入路径
计算机\HKEY_CLASSES_ROOT\.js
- 将
Content Type
的数据改为text/javascript
- 清除浏览器缓存,刷新浏览器,无效QAQ
- 重启电脑,可见右侧显示了 Toolbar