【问题标题】:Getting Started with Tornado龙卷风入门
【发布时间】:2009-09-16 22:43:30
【问题描述】:

通过 apt(python 2.5、simplejson 等)安装必要的软件包后,我在尝试运行演示时遇到错误。

: Request instance has no attribute 'responseHeaders' /usr/lib/python2.5/site-packages/tornado/web.py, line 404 in flush 402 for k,v in self._generate_headers(): 403 if isinstance(v, list): 404 self.request.responseHeaders.setRawHeaders(k, v) 405 else: Self request twisted.web.server.Request instance @ 0x85da24c Locals self k 'Set-Cookie' v List instance @ 0x85da46c

这是安装必要软件包的证明

/web/tmp/tornado/demos/helloworld# dpkg -l | grep python2.5 ii python2.5 2.5.2-2ubuntu6 An interactive high-level object-oriented la ii python2.5-dev 2.5.2-2ubuntu6 Header files and a static library for Python ii python2.5-minimal 2.5.2-2ubuntu6 A minimal subset of the Python language # dpkg -l | grep simplejson ii python-simplejson 1.7.3-1 # dpkg -l | grep pycurl ii python-pycurl 7.16.4-1

似乎没有太多人从朋友圈尝试过这个 Tornado 的东西。任何人有任何建议/提示可以帮助我启动并运行它吗?

【问题讨论】:

    标签: python twisted tornado


    【解决方案1】:

    我的印象是龙卷风并不依赖于扭曲。您是否尝试过“官方”版本?第 404 行完全不同。

    http://github.com/facebook/tornado/blob/master/tornado/web.py

    def flush(self, include_footers=False):
        """Flushes the current output buffer to the nextwork."""
        if self.application._wsgi:
            raise Exception("WSGI applications do not support flush()") #line 404
        if not self._headers_written:
            self._headers_written = True
            headers = self._generate_headers()
        else:
            headers = ""
    

    除此之外,我会尝试安装 twisted 看看会发生什么

    【讨论】:

    • Tornado 不依赖于 Twisted。
    • 当我说“我觉得龙卷风并不依赖于扭曲”时,这就是我的意思。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多