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
- How can I select and order items based on a subquery?
- Python 3.4 , django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet
- Django {% if custom_template_tag > 0 %} does not work
- Django REST: Creating db entries in related table in one POST
- Django Rest-Framework Serializer: KeyError thrown on field that certainly exists
Source:stackexchange.com