python龙旋风图形代码_python – 无法使用gunicorn运行龙卷风应用程序

我无法使用gunicorn运行龙卷风应用程序.启动应用程序时出错.我想用gunicorn运行它,因为我需要一些很好的功能,如:graceful-timeout,response-timeout等…

龙卷风app:

$cat wsgi.py

源代码:

import tornado.web

import tornado.wsgi

from api.handler import MainHandler, ApiV2Handler, InvalidRequestHandler

def app(*args):

app = tornado.web.Application([

(r"/", MainHandler),

(r"(/v3/(\w+)/(\w+)/)", ApiV2Handler),

(r"(/v3/(\w+)/(\w+))", InvalidRequestHandler)

])

return tornado.wsgi.WSGIContainer(tornado.wsgi.WSGIAdapter(app))

庆典:

$gunicorn wsgi:app --bind 127.0.0.1:9080

追溯:

[2015-07-06 14:41:16 +0000] [21806] [INFO] Starting gunicorn 19.3.0

[2015-07-06 14:41:16 +0000] [21806] [INFO] Listening at: http://127.0.0.1:9080 (21806)

[2015-07-06 14:41:16 +0000] [21806] [INFO] Using worker: sync

[2015-07-06 14:41:16 +0000] [21811] [INFO] Booting worker with pid: 21811

[2015-07-06 14:41:21 +0000] [21811] [ERROR] Error handling request

Traceback (most recent call last):

File "venv/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 130, in handle

self.handle_request(listener, req, client, addr)

File "venv/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 176, in handle_request

for item in respiter:

TypeError: 'WSGIContainer' object is not iterable

^C[2015-07-06 14:41:23 +0000] [21806] [INFO] Handling signal: int

[2015-07-06 14:41:23 +0000] [21811] [INFO] Worker exiting (pid: 21811)

[2015-07-06 14:41:23 +0000] [21806] [INFO] Shutting down: Master

有任何想法吗?

Ben Darnell的更新:

我试过这个:

import tornado.web

import tornado.wsgi

from api.handler import MainHandler, ApiV2Handler, InvalidRequestHandler

def app(*args):

app = tornado.web.Application([

(r"/", MainHandler),

(r"(/v3/(\w+)/(\w+)/)", ApiV2Handler),

(r"(/v3/(\w+)/(\w+))", InvalidRequestHandler)

])

return tornado.wsgi.WSGIAdapter(app)

但结果是一样的:

TypeError: 'WSGIAdapter' object is not iterable

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值