This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
DUT2PTUT/superTornado.py

22 lines
535 B
Python
Raw Normal View History

2014-02-27 14:43:58 +00:00
import tornado.ioloop
import tornado.web
2014-02-27 15:55:33 +00:00
import tornado.httpserver
2014-02-27 14:43:58 +00:00
2014-02-27 15:06:38 +00:00
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.render("index.html")
2014-02-27 15:45:10 +00:00
2014-02-27 15:46:28 +00:00
class LoginHandler(tornado.web.RequestHandler):
2014-02-27 16:40:23 +00:00
def get(self):
2014-02-27 16:42:14 +00:00
self.write("Le pseudo est :")
2014-02-27 14:43:58 +00:00
2014-02-27 15:06:38 +00:00
application = tornado.web.Application([
(r"/", MainHandler),
2014-02-27 15:50:02 +00:00
(r"/login", LoginHandler),
2014-02-27 15:06:38 +00:00
])
2014-02-27 14:43:58 +00:00
2014-02-27 14:51:19 +00:00
if __name__ == "__main__":
2014-02-27 15:56:43 +00:00
http_server = tornado.httpserver.HTTPServer(application)
2014-02-27 15:53:58 +00:00
http_server.listen(80)
2014-02-27 15:06:38 +00:00
tornado.ioloop.IOLoop.instance().start()