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.
How exactly are you running your environment? Are you doing this with a runserver command? Or are you running this under a real web server such as Apache / mod_wsgi or nginx / uwsgi?
I’m runnning this envinronment with Apache / mod_wsgi.So I’m typing “systemctl restart httpd” to restart my webapp.
About django runnning mode, I’m using setting.py with “DEBUG = True”.
In your settings file in your repo, I didn’t see settings for STATIC_ROOT (only needed in a production mode) or STATICFILES_DIRS.
I tried it once but it didn’t worked. So I erased it in commiting files.
I thought it does’t needed when running as debug mode. Or do I need it when I run with Apache / mod_wsgi?
By the way, Is that possible this error caused by my httpd.conf?
I’m not familier with wsgi, so now I’m doubting it.
I added following option to my httpd.conf from default.