Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 *-*
  3.  
  4. import tornado.web
  5. import tornado.httpserver
  6. import tornado.ioloop
  7.  
  8. class MainHandler(tornado.web.RequestHandler):
  9.  
  10.   def get(self, *args, **kwargs):
  11.     self.write("get isteği sayfayı göster")
  12.  
  13.   def post(self, *args, **kwargs):
  14.     self.write("form post kontrol et veri tabanına göm")
  15.  
  16.   def del(self, *args, **kwargs):
  17.     self.write("delete işlemi")
  18.  
  19.  
  20. class Application(tornado.web.Application):
  21.   def __init__(self):
  22.     settings = {
  23.       'debug': False
  24.     }
  25.     handlers = [
  26.       (r'/', MainHandler)
  27.     ]
  28.     tornado.web.Application.__init__(self, handlers, **settings)
  29.  
  30.  
  31.  
  32. if __name__ == '__main__':
  33.     http_server = tornado.httpserver.HTTPServer(Application())
  34.     http_server.listen(8888)
  35.     tornado.ioloop.IOLoop.instance().start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement