Skip to content
Advertisement

Django: Refused to apply style from … because its MIME type (‘text/html’) is not a supported stylesheet MIME type

i am trying to connet my style.css in django template using the static files {% static 'assets/css/style.css' %} but i keep seeing this error Refused to apply style from 'http://127.0.0.1:8000/assets/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.. NOTE: when i copy my css and manually paste it in a style tag inside the section everything works fine, but my css have over 23,000 lines of code and it’s too much to be sitting in the head section of my project. Please how do i go about fixing this error.

index.html

JavaScript

tree

JavaScript

Advertisement

Answer

all i did was add this line in my base.html head section

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement