2011-10-07 68 views
0

本周我使用Facebook的龙卷风框架,而且我有时在互联网不明显的地方。由于website在回购中,我怎样才能让它在本地运行?它在AppEngine下吗?在本地运行龙卷风文档

我第一次跑了我没有看里面,所以我只是做了,

python website.py 

这给了以下良好,

Traceback (most recent call last): 
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/wsgiref/handlers.py", line 93, in run 
    self.result = application(self.environ, self.start_response) 
    File "/Users/phwd/tornado/website/tornado/wsgi.py", line 90, in __call__ 
    handler = web.Application.__call__(self, HTTPRequest(environ)) 
    File "/Users/phwd/tornado/website/tornado/wsgi.py", line 107, in __init__ 
    self.method = environ["REQUEST_METHOD"] 
KeyError: 'REQUEST_METHOD' 
Status: 500 Dude, this is whack! 
Content-Type: text/plain 
Content-Length: 59 

哦好了,所以它使用WSGI的.py?我试图从谷歌应用程序引擎,而不是调用它,

dev_appserver.py . 

它开始的第一页,但只要我偷看到主文档

ERROR 2011-10-07 17:26:59,566 dev_appserver.py:3360] Error encountered reading file "/Users/phwd/tornado/website/sphinx/build/html/index.html": 
[Errno 2] No such file or directory: '/Users/phwd/tornado/website/sphinx/build/html/index.html' 
INFO  2011-10-07 17:26:59,574 dev_appserver.py:4247] "GET /documentation/index.html HTTP/1.1" 404 

有什么我需要与狮身人面像做对在Tornado Web服务器上获得本地文档工作?那里有一个conf.py文件,所以不是已经安装好了吗?

如何运行网站应用程序以及我需要使用哪些必要的依赖关系?

回答

1

回购不包含为文档构建的HTML。在“tornado/website /”目录中运行make

此外,请确保您已安装mysqldb。

(为什么一个Web服务器的文档需要你再跑,显著恶化的Web服务器来读取它是超越我,虽然。)

+0

没有HTML做到这一点很遗憾,所以我会得到“没有规则,使目标”,在Makefile中有'狮身人面像建造-b HTML $(SPHINXOPTS)狮身人面像/建设/ html' ,那么下一步将是'make html'否?我将尝试从主服务器获取最新版本,以查看是否会改变任何内容。为什么文档在服务器上?不知道......我在想同样的事情,而我在这里。我可能会因为挫折而在tornadoweb.org上使用wget。 – phwd

2
在一些代码 wsgiref.handlers.CGIHandler().run(app)

被使用,那么我们就会有这个问题, 用下面的代码替换,它可能工作。

from wsgiref.simple_server import make_server 
app = tornado.wsgi.WSGIApplication(
    ... 
    ) 
httpd = make_server('',8000,app) 
httpd.serve_forever()