httplib CannotSendRequest error in WSGI

后端 未结 2 965
醉话见心
醉话见心 2020-12-01 18:42

I\'ve used two different python oauth libraries with Django to authenticate with twitter. The setup is on apache with WSGI. When I restart the server everything works grea

2条回答
  •  悲&欢浪女
    2020-12-01 18:50

    This exception is raised when you reuse httplib.HTTP object for new request while you havn't called its getresponse() method for previous request. Probably there was some other error before this one that left connection in broken state. The simplest reliable way to fix the problem is creating new connection for each request, not reusing it. Sure, it will be a bit slower, but I think it's not an issue having you are running application in single process and single thread.

提交回复
热议问题