Created
March 1, 2013 10:10
-
-
Save troter/5063712 to your computer and use it in GitHub Desktop.
run reviewboard with tornado (without apache)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
execfile('./htdocs/reviewboard.wsgi') | |
from tornado.options import options, define, parse_command_line | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.web | |
import tornado.wsgi | |
define('port', type=int, default=8080) | |
def main(): | |
tornado.options.parse_command_line() | |
wsgi_app = tornado.wsgi.WSGIContainer(application) | |
tornado_app = tornado.web.Application([ | |
(r"/favicon.ico", tornado.web.RedirectHandler, {"url": "/static/rb/images/favicon.png"}), | |
(r"/static/(.*)", tornado.web.StaticFileHandler, {"path": "./htdocs/static"}), | |
(r"/media/(.*)", tornado.web.StaticFileHandler, {"path": "./htdocs/media"}), | |
(r"/errordocs/(.*)", tornado.web.StaticFileHandler, {"path": "./htdocs/errordocs"}), | |
('.*', tornado.web.FallbackHandler, dict(fallback=wsgi_app)), | |
]) | |
server = tornado.httpserver.HTTPServer(tornado_app) | |
server.listen(options.port) | |
tornado.ioloop.IOLoop.instance().start() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment