2012-08-22 1 views
0

전 tornadoweb과 fanstatic.org를 통합하려고 시도하고 있으며 사전 지식이 있거나 다른 사람이이 작업을 수행하는 방법을 반영 할 수있는 코드가 있다면 궁금합니다. 나는 문서를 읽고 있었고 토네이도가 wsgi 인터페이스를 제공하기 때문에 할 수 있다고 생각한다.fanstatic와 tornado web의 통합?

감사

답변

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