这是我使用 uWSGI 启动 django 的方法。
command = /usr/local/bin/uwsgi --loop gevent --socket 127.0.0.1:8070 --processes 2 --pp =/home/ubuntu/workspace/htFrontEnd/htdjango --wsgi-file =/home/ubuntu/workspace/htFrontEnd/htdjango/wsgi.py -b 32768 --master --async 20 --enable-threads --listen 2048
这是我在日志中得到的错误......
wsgi.phy 的位置正确:/home/ubuntu/workspace/htFrontEnd/htdjango/wsgi.py
your memory page size is 4096 bytes
detected max file descriptor number: 1024
async fd table size: 1024
allocated 20800 bytes (20 KB) for 20 cores per worker.
lock engine: pthread robust mutexes
uwsgi socket 0 bound to TCP address 127.0.0.1:8070 fd 3
Python version: 2.7.3 (default, Aug 1 2012, 05:25:23) [GCC 4.6.3]
Python main interpreter initialized at 0xab4ef0
python threads support enabled
your server socket listen backlog is limited to 2048 connections
*** Operational MODE: preforking+async ***
added =/home/ubuntu/workspace/htFrontEnd/htdjango to pythonpath.
failed to open python file =/home/ubuntu/workspace/htFrontEnd/htdjango/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: 1935)
spawned uWSGI worker 1 (pid: 2037, cores: 20)
spawned uWSGI worker 2 (pid: 2038, cores: 20)
*** running gevent loop engine [addr:0x44f950] ***
timeout. skip request.
这是我的 wsgi.py 文件。
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "htdjango.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()