这是我第一次使用uWsgi
的牛仔竞技表 - 但是在尝试配置它之后,它并不是最顺利的过程。
我正在使用uWsgi
运行Nginx
(nginx
正常运行)。
我正在尝试加载uwsgi
:
1)uwsgi --socket 127.0.0.1:5000 --chdir /path/to/my/django/application --wsgi-file django/application/wsgi.py --master --processes 4 --threads 2
或
2)uwsgi --ini runserver.ini
结果:最终没有正确部署应用程序。
当我运行第二个命令尝试时,我得到如下输出:
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /my/django/application/directory
detected binary path: /usr/local/bin/uwsgi
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:5000 fd 3
Python version: 2.6.5 (r265:79063, Feb 27 2014, 19:56:00) [GCC 4.4.3]
Python main interpreter initialized at 0x86ac688
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 357000 bytes (348 KB) for 8 cores
*** Operational MODE: preforking+threaded ***
failed to open python file hook_project/wsgi.py
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 ***
spawned uWSGI master process (pid: 7477)
spawned uWSGI worker 1 (pid: 7478, cores: 2)
spawned uWSGI worker 2 (pid: 7479, cores: 2)
spawned uWSGI worker 3 (pid: 7480, cores: 2)
spawned uWSGI worker 4 (pid: 7481, cores: 2)
nginx config
upstream django {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server xxx.xxx.xxx.xxx:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 8003;
# the domain name it will serve for
server_name xxx.xxx.xxx.xxx; # substitute your machine's IP address or FQDN
access_log /var/www/nginx_log/access.log;
error_log /var/www/nginx_log/error.log;
charset utf-8;
location /static {
# the Django project's static files
alias /path/to/django/static;
}
location / {
uwsgi_pass django;
include /etc/nginx/uwsgi_params; # or the uwsgi_params you installed manually
}
# max upload size
client_max_body_size 75M; # adjust to taste
}
任何人都可以建议为什么我的应用程序根本没有加载而且uwsgi未能加载django应用程序?