Skip to content

Instantly share code, notes, and snippets.

@peterbe
Created June 23, 2011 20:52
Show Gist options
  • Save peterbe/1043604 to your computer and use it in GitHub Desktop.
Save peterbe/1043604 to your computer and use it in GitHub Desktop.
How I start my tornado app
def main(): # pragma: no cover
tornado.options.parse_command_line()
http_server = tornado.httpserver.HTTPServer(Application())
print "Starting tornado on port", options.port
http_server.listen(options.port)
try:
tornado.ioloop.IOLoop.instance().start()
except KeyboardInterrupt:
pass
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment