2012-08-22 83 views
0

我試圖將fanstatic.org與tornadoweb集成,並且很好奇,如果任何人有任何先前的知識或任何代碼可能反映如何完成?我一直在閱讀文檔,我相信它可以完成,因爲龍捲風確實提供了一個wsgi接口。fanstatic與龍捲風網絡集成?

感謝

回答

0
import tornado.wsgi 
from fanstatic import Fanstatic 

from your_tornado_app import MainHandler # tornado.web.RequestHandler 

app = tornado.wsgi.WSGIApplication([ 
    (r"/", MainHandler), 
]) 
app = Fantastic(app) 

if __name__ == '__main__': 
    from wsgiref.simple_server import make_server 

    server = make_server('127.0.0.1', 8080, app) 
    server.serve_forever() 
+1

我希望fanstatic不僅限於WSGI作爲去除龍捲風如此多的靈活性 – battlemidget