Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如果我在Django项目中使用eventlet.wsgi';s`wsgi.py`?_Python_Uwsgi - Fatal编程技术网

Python 如果我在Django项目中使用eventlet.wsgi';s`wsgi.py`?

Python 如果我在Django项目中使用eventlet.wsgi';s`wsgi.py`?,python,uwsgi,Python,Uwsgi,如果我在Django项目的wsgi.py中使用eventlet,我可以使用uWSGI吗 在我的项目的wsgi.py中: import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AProject.settings") from socketio import Middleware from xxx.website_chat.vie

如果我在Django项目的
wsgi.py
中使用eventlet,我可以使用uWSGI吗

在我的项目的
wsgi.py
中:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AProject.settings")


from socketio import Middleware
from xxx.website_chat.views import sio
django_app = get_wsgi_application()
application = Middleware(sio, django_app)

import eventlet
import eventlet.wsgi
eventlet.wsgi.server(eventlet.listen(('', 8000)), application)
在那里,我使用
eventlet.wsgi.server()
来执行我的应用程序,无论我在分发项目时是否仍然需要uWSGI作为Web服务器


编辑-1

我的意思是,如果我仍然需要uWSGI作为Web服务器,如果我使用下面的代码:

eventlet.wsgi.server(eventlet.listen(('', 8000)), application)

编辑-2

我在我的项目
wsgi.py
中使用
eventlet.wsgi.server

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AProject.settings")


from socketio import Middleware
from xxx.website_chat.views import sio
django_app = get_wsgi_application()
application = Middleware(sio, django_app)

import eventlet
import eventlet.wsgi
eventlet.wsgi.server(eventlet.listen(('', 8000)), application)

导入eventlet.wsgi
eventlet.wsgi.server(eventlet.listen(“”,8000)),应用程序)

现在我想分发我的项目

当我使用
uwsgi--ini-uwsgi.ini

将出现以下错误:

mapped 208320 bytes (203 KB) for 4 cores
*** Operational MODE: threaded ***
django.setup()
Traceback (most recent call last):
  File "myProject/wsgi.py", line 30, in <module>
    eventlet.wsgi.server(eventlet.listen(('', 8000)), application)
  File "/Users/lll/Desktop/myProject/Project/myProject/venv/lib/python3.5/site-packages/eventlet/convenience.py", line 78, in listen
    sock.bind(addr)
OSError: [Errno 48] Address already in use
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: 11413)
spawned uWSGI worker 1 (pid: 11418, cores: 4)
spawned uWSGI http 1 (pid: 11419)
因此eventlet.wsgi无法侦听地址:
eventlet.listen((“”,8000))


当我分发我的项目时,我是否不需要uWSGI?是否直接使用eventlet.wsgi.server

你的问题不清楚。你仍然需要一些东西来运行WSGI应用程序,不是吗?@DanielRoseman你的意思是我仍然需要uwsgi来运行我的应用程序吗?