Hello everyone. I’m beginner of Django. Now I’m trying to finish tutorial. I got trouble on step6.
Google chrome developer tool’s console says
‘localhost/:1 Refused to apply style from ‘http://localhost:8080/static/practice1/style.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.’
I’m testing it on my virtualmachine using Vagrant. About detail enviroment please check github repository below.
I’m following django tutorial steps. I changed only 3 things intentionaly.
1.Changed app name from polls to practice1.
2.Changed setting to use postgres server.
3.Changed setting to use apache and wsgimod.
In my understanding way toplace my static files is following steps.
1.Check setting.py parameter ‘DEBUG = True’.
2 Set parameter ‘STATIC_URL’ & ‘STATIC_ROOT’ in setting.py.
3.Place static files on /PROJECT_ROOT/APP_ROOT/static/APP_NAME_FOLDER/STATCI_FILE_SELF (ex./my_first_django/polls/static/polls/style.css)
I know threre is some similer topix here. As following
I tried “python manage.py collectstatic”.(even it looks like used on produciton mode)
I tried adding following code on setting.py.
mimetypes.add_type(“text/css”, “.css”, True)”
I tried set “STATICFILES_DIRS” in setting.py like “PROJECT_ROOT/polls/static/polls/style.css”.(I think this is setting for when I want to place file in another place where is not in app directory.)
But couldnt solve this error.
Plese help me solve this error. And let me know whatis wrong with me.