1

在我的项目中,我使用猴子补丁将 django-development 服务器替换为 gevent 并且它运行良好,所以现在我的 manage.py 文件看起来像 -

from gevent import monkey; monkey.patch_all()
from gevent.wsgi import WSGIServer
from django.core.management import setup_environ
import settings
setup_environ(settings)

from django.core.handlers.wsgi import WSGIHandler as DjangoWSGIApp
application = DjangoWSGIApp()
server = WSGIServer(("192.168.0.14", 8080), application)
try:
 print "Starting Green server on http://192.168.0.14:8000"
 server.serve_forever()
except KeyboardInterrupt:
 server.stop()
 print "server has stopped by Admin"

所以这对我来说很好,当我正常运行它时。然后我尝试将它托管在我们的私有云上​​,因为我使用了三个实例,一个用于openid provider,另一个用作openid consumer,一个用于mongodb,它也按预期工作,但我遇到了一些cross domain问题,所以我现在proxy使用解决这个问题。

问题-

1- 使用云实例

然后我尝试使用 ( python manage.py &) 守护脚本,以便我可以关闭与我的实例的 ssh 连接,在守护进程后我能够使用第一个实例,但是每当我尝试登录或注销时,我都会得到I/O error

2-在开发PC上

守护进程后,i tried to access the url, it wasn't connecting当我使用“ps aux | grep manage.py”检查进程时,脚本在那里运行。

我想我在守护这个脚本时遗漏了一些东西。我使用了python daemon图书馆,但这也不起作用。

4

0 回答 0