Вопрос

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