I am trying to configure uswgi with nginx
The steps I followed are:
Install NGINX
sudo yum install nginx
sudo /etc/init.d/nginx start &
Pip
yum -y install python-pip
Install Python
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar -xzf Python-2.7.6.tgz
cd Python-2.7.6
./configure
make
sudo make install
Install Uwsgi
pip install uwsgi
Install Django
sudo pip install git+https://github.com/django-nonrel/django
Command
uwsgi --socket /tmp/wsgi.sock --module App.wsgi:application --chmod-socket=666 -H /usr/local/bin/python --master --processes 4 --threads 2 &
Error
"wsgi.py", line 10, in <module>
import os
ImportError: No module named os
unable to load app 0 (mountpoint='') (callable not found or import error)
wsgi.py content
10: import os
11: os.environ.setdefault("DJANGO_SETTINGS_MODULE", "SecurityInsights.settings")
12:
13: from django.core.wsgi import get_wsgi_application
14: application = get_wsgi_application()
And there is no problem while loading os module in console
/usr/local/bin/python
Python 2.7.6 (default, Sep 9 2014, 18:55:35)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>>
EDIT
as per @ZZY suggesstion I checked the python version in python manage.py shell
, it is different 2.6.9 than global 2.7.6. Is this making any difference?