【Django】because its MIME type (‘texthtml‘) is not executable, and strict MIME type checking is enab

【Django】because its MIME type (‘texthtml‘) is not executable, and strict MIME type checking is enab,第1张

【Django】because its MIME type (‘text/html‘) is not executable, and strict MIME type checking is enab

报错内容

because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 

问题分析 

静态文件被当成接口请求了,需要在middleware类中处理跳转问题,当包含static关键字时允许继续。(因为我的静态文件的路径就是以static开头的,如/static/js/admin.js)

如果还不行,则可能是文件不存在,复制静态文件所在的包,目录名改为static。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5625505.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-15
下一篇2022-12-15

发表评论

登录后才能评论

评论列表(0条)

    保存