Python:Django templates下的html加载css问题

控制台提示refused to apply style from 'xxxx' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

在Django项目对应app下创建文件夹static用于存放项目相关静态文件如css、img等,static下也可再创建子文件夹,

在前端引用static下的文件时,路径前加上/static/

<link rel="shortcut icon" href="/static/img/icon/logo.jpeg" />

settings配置文件内容基本是默认生成的内容未进行相关修改

 

posted @ 2022-05-08 01:51  诟笑  阅读(347)  评论(0编辑  收藏  举报