title: How to display image on web browser using Tornado Python server?
body: <p>The error says the the indent is at the "if _name" etc. part.. I'm not sure why it would indicate this.</p>
  
  <pre><code>class GetFileHandler(tornado.web.RequestHandler):
      def get(self):
  
          fileid = self.get_argument('fileid', "")
  
          cur.execute("""SELECT filepath FROM files_table WHERE file_id = %s""", (fileid, ))
          m = cur.fetchall()
          y = m[0]
          x = y[0]
  
          path = x + "/" + fileid + ".jpg"
  
          try:
              with open(path, 'rb') as f:
                  data = f.read()
                  self.write(data)
              self.finish()
  if __name__ == "__main__": 
      tornado.options.parse_command_line() 
      app = tornado.web.Application(handlers=[(r"/getit", GetFileHandler)])
      http_server = tornado.httpserver.HTTPServer(app) 
      http_server.listen(options.port) 
      tornado.ioloop.IOLoop.instance().start()
  </code></pre>