127.0.0.1/:1 Refused to execute script from 'http://127.0.0.1:8000/scripts/scripts.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
how do i even fix this?
i have generated a template from django and they look messy so i want to organise files like .css files and pages files…
i tried to add my .css file and routed the html to use this .css. later i discovered that i gotta add
{% load static %}
to load static files i have added this too and still not working….
in the image i made a styles folder and wanted to use that but not the site.css file, i think i need to edit some things in the settings.py can you guys instruct me?
2
Answers
Please add this to setting.py file and try again.
For http://127.0.0.1:8000/scripts/scripts.js:-
Could you try to visit the URL from your browser and check whether the file is loading? You can also debug through developer’s tools in your browser, click F12, and go to the Network tab.
For styles.css:-
Could you add this to your settings.py file?
Now, if your file path is
/static/somepath/styles.css
You can easily access the file with this.