[Fixed]-Start apache with mod_wsgi missing dango.core.wsgi

0πŸ‘

βœ…

i found the answer.
Using another stackoverflow, which I’m trying to re-locate again….I found out that my mod_wsgi was setup under the default python when installed under YUM.

So this is what I did:
I downloaded the new mod_wsgi from source, extracted it, then went into the folder. I then ran the following:

sudo ./configure --with-python=/usr/local/bin/python3.4
sudo make
sudo make install

This reset the mod_wsgi to the correct python, and from there, it all fell into place.

πŸ‘€arcee123

1πŸ‘

Have you tried this yet? ImportError: No module named django.core.wsgi Apache + VirtualEnv + AWS + WSGI I think it’s a problem with your wsgi.py code.

EDIT:

I can show you the configuration that worked for me in a Centos VPS:

In httpd.conf

WSGIPythonPath /path/to/project/folder
<VirtualHost YourServerIp:80>
     #WSGI conf

     ServerName mysite.co
     ServerAlias www.mysite.co
     WSGIScriptAlias / /path/to/your/project/main/wsgi.py

     Alias /robots.txt /path/to/your/robots.txt/folder

     Alias /media/ /path/to/your/project/media/folder/
     Alias /static/ /path/to/your/project/static/folder/

     <Directory /path/to/your/project/static/folder/>
     Order deny,allow
     Allow from all
     </Directory>

     <Directory /path/to/your/project/media/folder/>
     Order deny,allow
     Allow from all
     </Directory>

     <Directory /path/to/your/project/wsgi.py/folder/>
     <Files wsgi.py>
     Order deny,allow
     Allow from all
     </Files>
     </Directory>
</VirtualHost>

And in my wsgi.py

 """
WSGI config for project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MainFolder.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
πŸ‘€Jose Romero

Leave a comment