首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Django,uWSGI,gevent循环-如何开始工作-无法加载应用程序0 (mountpoint='')

Django,uWSGI,gevent循环-如何开始工作-无法加载应用程序0 (mountpoint='')
EN

Stack Overflow用户
提问于 2012-11-04 21:10:54
回答 2查看 3.2K关注 0票数 1

下面是我如何使用uWSGI启动django。

代码语言:javascript
复制
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

这是我在日志中得到的错误...

/home/ubuntu/workspace/htFrontEnd/htdjango/wsgi.py : wsgi.phy的位置正确

代码语言:javascript
复制
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文件。

代码语言:javascript
复制
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "htdjango.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-11-05 03:23:58

这是一个打字错误:

从=/home/ubuntu/workspace/htFrontEnd/htdjango/wsgi.py和=/home/ubuntu/workspace/htFrontEnd/htdjango中删除=(等号

票数 1
EN

Stack Overflow用户

发布于 2012-11-04 22:27:16

我注意到这已经在发生了-- added =/home/ubuntu/workspace/htFrontEnd/htdjango to pythonpath.,但是为了确认一下,你能不能在你的wsgi.py文件中再添加一行-

代码语言:javascript
复制
`sys.path.append('/home/ubuntu/workspace/htFrontEnd/htdjango')`

当您再次尝试运行stdout时,如果stdout中有任何变化,请让我知道。

application = get_wsgi_application()发生时肯定有问题,因为这个错误消息告诉我们uwsgi找不到我们的django应用程序。

你有没有碰巧在用virtualenv?你的django库在virtualenv中吗?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13218799

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档