Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/339.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 这一行“eventlet.wsgi.server(eventlet.listen(';';和#x27;8000)),application)是什么;s函数?_Python_Django_Wsgi - Fatal编程技术网

Python 这一行“eventlet.wsgi.server(eventlet.listen(';';和#x27;8000)),application)是什么;s函数?

Python 这一行“eventlet.wsgi.server(eventlet.listen(';';和#x27;8000)),application)是什么;s函数?,python,django,wsgi,Python,Django,Wsgi,我在wsgi.py中设置了以下代码: eventlet.wsgi.server(eventlet.listen(('', 8000)), application) 如果我使用: python3 manage.py runserver 0.0.0.0:8001 它将忽略python3 manage.py运行服务器0.0.0.0:8001的8001端口 因为日志是: $ python manage.py runserver 0.0.0.0:8001 Performing system check

我在
wsgi.py
中设置了以下代码:

eventlet.wsgi.server(eventlet.listen(('', 8000)), application)
如果我使用:

python3 manage.py runserver 0.0.0.0:8001
它将忽略
python3 manage.py运行服务器0.0.0.0:8001
8001
端口

因为日志是:

$ python manage.py runserver 0.0.0.0:8001
Performing system checks...

System check identified no issues (0 silenced).
May 09, 2018 - 10:48:35
Django version 1.11.5, using settings 'Qiyun02.settings'
Starting development server at http://0.0.0.0:8001/
Quit the server with CONTROL-C.
(4516) wsgi starting up on http://0.0.0.0:8000  # you see this is using 8000
如果此行设置为:

eventlet.wsgi.server(eventlet.listen(('', 8000)), application)
('',8000)
表示:
0.0.0.0:8000

是evenlet wsgi的简单配置文件,在
wsgi.py
中,您使用
eventlet
wsgi作为应用程序的wsgi

eventlet.wsgi.server(eventlet.listen(('', 8000)), application)
eventlet.listen()
eventlet.wsgi.server()
的一个参数,
eventlet.listen()
表示侦听哪个地址和端口

('',8000)
组合了地址和端口。如果我们不设置第一个参数,它将是默认的
0.0.0.0

如果我们设置
localhost
,它将是回溯地址
127.0.0.1
。 我们还可以设置计算机的IP地址

我们可以使用
ifconfig-a
列出*nix计算机的可用IP地址。 使用
ipconfig-a
列出Windows的