How do you mount Bottle app in Tornado server? Here is my code
Asked
Active
Viewed 1,261 times
1 Answers
2
bottle.default_app()
returns a WSGI callable:
if __name__ == "__main__":
bottle_app = bottle.default_app()
bottle_handler = tornado.wsgi.WSGIContainer(bottle_app)
HTTPServer(Application([(r"/ws", WSHandler),
(r"/css/(.*)", StaticFileHandler, {"path": "./css/"}),
(r"/js/(.*)", StaticFileHandler, {"path": "./js/"}),
(r"/img/(.*)", StaticFileHandler, {"path": "./img/"}),
("/(.*)", bottle_handler)])
).listen(1024)
IOLoop.instance().start()

defnull
- 4,169
- 3
- 24
- 23
-
1I already created a project on the github https://github.com/cime/bottle-tornadosocket :) – redman Apr 26 '12 at 21:38