I'm attempting to integrate fanstatic.org with tornadoweb and was curious if anyone has any prior knowledge or any code that may reflect how this is done? I've been reading the documentation and i believe it can be done since tornado does provide a wsgi interface.

thanks

有帮助吗?

解决方案

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()
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top