I think I have a 50% solution, the cookie has not been verified yet, but now I can download the Flask application using Tornado and mix Tornado + Flask together :)
first here is the flasky.py file where the jar is located:
from flask import Flask app = Flask(__name__) @app.route('/flask') def hello_world(): return 'This comes from Flask ^_^'
and then a cyclone.py file that will load the flask application and the tornado server + a simple tornado application, hope there is no module called "cyclone" ^ _ ^
from tornado.wsgi import WSGIContainer from tornado.ioloop import IOLoop from tornado.web import FallbackHandler, RequestHandler, Application from flasky import app class MainHandler(RequestHandler): def get(self): self.write("This message comes from Tornado ^_^") tr = WSGIContainer(app) application = Application([ (r"/tornado", MainHandler), (r".*", FallbackHandler, dict(fallback=tr)), ]) if __name__ == "__main__": application.listen(8000) IOLoop.instance().start()
hope this helps someone who wants to mix them :)
abdel Nov 23 '11 at 18:44 2011-11-23 18:44
source share