目前,我在 Ubuntu 14.04 上运行 vagrant 服务器,并使用简单的python manage.py runserver 0.0.0.0:8000
由于我使用 chrome through 连接到 django 网络服务器http://localhost:8000
并且服务器在 VM 上运行,因此我通过使用以下设置进行端口转发Vagrantfile
config.vm.network "forwarded_port", guest: 8000, host: 8000
一切正常运行(所有模块/视图/测试都按预期运行),但是,自从我开始使用以来,grequests
我得到了这个奇怪的错误
Exception happened during processing of request from ('10.0.2.2', 63520)
Traceback (most recent call last):
File "/home/vagrant/anaconda3/lib/python3.6/socketserver.py", line 639, in process_request_thread
self.finish_request(request, client_address)
File "/home/vagrant/anaconda3/lib/python3.6/socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/home/vagrant/anaconda3/lib/python3.6/socketserver.py", line 696, in __init__
self.handle()
File "/home/vagrant/anaconda3/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 159, in handle
self.raw_requestline = self.rfile.readline(65537)
File "/home/vagrant/anaconda3/lib/python3.6/socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "/home/vagrant/anaconda3/lib/python3.6/site-packages/gevent/_socket3.py", line 385, in recv_into
self._wait(self._read_event)
File "/home/vagrant/anaconda3/lib/python3.6/site-packages/gevent/_socket3.py", line 157, in _wait
self.hub.wait(watcher)
File "/home/vagrant/anaconda3/lib/python3.6/site-packages/gevent/hub.py", line 651, in wait
result = waiter.get()
File "/home/vagrant/anaconda3/lib/python3.6/site-packages/gevent/hub.py", line 899, in get
return self.hub.switch()
File "/home/vagrant/anaconda3/lib/python3.6/site-packages/gevent/hub.py", line 630, in switch
return RawGreenlet.switch(self)
gevent.hub.LoopExit: ('This operation would block forever', <Hub at 0x7f3b777e8af8 epoll pending=0 ref=0 fileno=34>)
请注意,我没有使用,并且即使没有调用它或其他任何东西grequests
,简单地导入它似乎也会导致此错误
有人有想法么?