Skip to content

Instantly share code, notes, and snippets.

@cjgiridhar
Created August 28, 2012 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjgiridhar/3498381 to your computer and use it in GitHub Desktop.
Save cjgiridhar/3498381 to your computer and use it in GitHub Desktop.
Tornado - Options - 3
from tornado.options import define, options
import tornado.web
import tornado.database
define("port", default="8888")
class DBHandler(tornado.web.RequestHandler):
def get(self):
self.write("Main")
application = tornado.web.Application([
(r"/db", DBHandler),
], debug=True)
if __name__ == '__main__':
tornado.options.parse_command_line()
application.listen(options.port)
tornado.ioloop.IOLoop.instance().start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment