Could not import CSS Jquery and bootstrap files

Hello

the application worked fine, except that the styles (CSS files) are not imported, I have this error:

La ressource à l’adresse « http://127.0.0.1:8000/static/styye/js/bootstrap.min.js » a été bloquée en raison d’un type MIME (« text/html ») incorrect (X-Content-Type-Options: nosniff)

The code in base.html to import those files is:

<link rel="stylesheet" type="text/css" href="{% static 'store/css/bootstrap.min.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'store/css/business-casual.css' %}" />

Thanks !

The error message you’re listing here refers to a bootstrap.min.js file, while the imports you’re showing are for css files. Where / how are you loading the js file within your template?

I had thesame error with CSS, JS files…

La ressource à l’adresse « http://127.0.0.1:8000/static/styye/js/jquery.js » a été bloquée en raison d’un type MIME (« text/html ») incorrect (X-Content-Type-Options: nosniff)

La ressource à l’adresse « http://127.0.0.1:8000/static/styye/css/business-casual.css » a été bloquée en raison d’un type MIME (« text/html ») incorrect (X-Content-Type-Options: nosniff)

The code used to load JS file within template is :

<script src="{% static 'styye/js/jquery.js' %}"></script>
<!-- Bootstrap Core JavaScript -->
<script src="{% static 'styye/js/bootstrap.min.js' %}"></script>

Thanks

Verify in your console log that those files are actually being retrieved and that you’re not getting a 404 with trying to reference them. (That’s the most common cause I’ve seen for this error. If it’s an incorrect path causing a 404, Django will return the 404 error page - html - instead of the intended css or js.) My guess is that you’ve got something wrong with your static file configuration parameters to where “/static/styye/js/jquery.js” isn’t pointing to the right directory in your file system.

You can also check this directly by trying to retrieve that file by specifying that url directly in your address bar in your browser.

There s no a 404, the application worked fine… the probleme is about this :
d’un type MIME (« text/html ») incorrect (X-Content-Type-Options: nosniff)

I’m not asking about what you’re showing in your browser, we need to see what response is generated on the server. If you’re running this in test in a console session, it would be what we see in the display where you’re running runserver.

Also, please enter that url (http://127.0.0.1:8000/static/styye/js/jquery.js) directly in the address bar in your browser - do not rely upon a page loading it.

Really, I didn’t understand what happened, cause when I changed the Browser used, the files (CSS, JS) are loaded!!