环境使用centos6.5 + django1.10.3+nginx+uwsgi
nginx.conf
server {
listen 80;
server_name 127.0.0.1
#access_log /data/www/wiki/logs/access.log;
#error_log /data/www/wiki/logs/error.log;
#charset UTF-8;
#access_log logs/host.access.log main;
location / {
uwsgi_pass 127.0.0.1:8001;
include uwsgi_params;
uwsgi_param UWSGI_SCRIPT wsgi;
uwsgi_param UWSGI_CHDIR /data/www/wiki/;
}
#error_page 404 /404.html;
location /static/ {
alias /data/www/wiki/static/;
index index.html index.htm;
}
location /papers/ {
alias /data/www/wiki/papers/;
}
}
wsgi.py文件放在项目的路径下
uwsgi.ini配置为
[uwsgi]
socket = 127.0.0.1:8001
home = /data/www/test
chdir = /data/www/wiki
wsgi-file = wiki/wsgi.py
master = true
vhost = true
no-site = true
workers = 2
reload-mercy = 10
vacuum = true
max-requests = 1000
limit-as = 512
buffer-size = 30000
运行uwsgi --ini uwsgi.ini
Set PythonHome to /data/www/test
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x2396ef0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 296016 bytes (289 KB) for 2 cores
*** Operational MODE: preforking ***
Traceback (most recent call last):
File "wiki/wsgi.py", line 13, in <module>
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
为什么会提示这个模块找不到呢? 我是使用pip安装uwsgj的