Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.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请求+;Azure虚拟机_Python_Django_Azure_Request_Ckan - Fatal编程技术网

Python请求+;Azure虚拟机

Python请求+;Azure虚拟机,python,django,azure,request,ckan,Python,Django,Azure,Request,Ckan,我使用python请求库在Azure VM(clean ubuntu 12.04)中的两个应用程序(django和ckan)之间进行对话 出现了非常有线的bug。这看起来像是request.post成功发送,但在我的代码运行过程中,我得到了504请求超时时间 Apache2、Nginx和Gunicorn(仅显示超时)日志是干净的。我的CKAN应用程序引发相同的错误,但端口不同: CKAN错误示例1: Exception happened during processing of request

我使用python请求库在Azure VM(clean ubuntu 12.04)中的两个应用程序(django和ckan)之间进行对话

出现了非常有线的bug。这看起来像是
request.post
成功发送,但在我的代码运行过程中,我得到了
504请求超时时间

Apache2、Nginx和Gunicorn(仅显示超时)日志是干净的。我的CKAN应用程序引发相同的错误,但端口不同:

CKAN错误示例1:

Exception happened during processing of request from ('127.0.0.1', 53555)
Traceback (most recent call last):
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/httpserver.py", line 1068, in process_request_in_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 640, in __init__
    self.finish()
  File "/usr/lib/python2.7/SocketServer.py", line 693, in finish
    self.wfile.flush()
  File "/usr/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
CKAN错误示例2:

----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 53344)
Traceback (most recent call last):
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/httpserver.py", line 1068, in process_request_in_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 640, in __init__
    self.finish()
  File "/usr/lib/python2.7/SocketServer.py", line 693, in finish
    self.wfile.flush()
  File "/usr/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
正如您所看到的,端口总是不同的。我的一个想法是——Azure关闭了所有端口,除非您指定要打开哪个端口


我有相同的代码库在本地正常工作

默认情况下,Azure linux虚拟机禁用除22之外的所有端口,以防止来自internet的入站请求。您可以尝试指定Django应用程序的端口,并使用ckan配置另一个VM的端点


另外,您可以参考在apache上部署django应用程序,并将其绑定到VM上的80端口。

默认情况下,Azure linux VM禁用除22之外的所有端口,以防止来自internet的入站请求。您可以尝试指定Django应用程序的端口,并使用ckan配置另一个VM的端点


此外,您可以参考在apache上部署django应用程序,并将其绑定到VM上的80端口。

是的,默认情况下,Azure linux VM禁用除22之外的所有端口,以防止来自internet的入站请求。您可以尝试指定Django应用程序的端口,并使用ckan配置其他VM的端点。是的,默认情况下,Azure linux VM禁用除22之外的所有端口,以防止来自internet的入站请求。您可以尝试指定Django应用程序的端口,并使用ckan配置另一个VM的端点。