index.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # coding=utf-8
  2. import os
  3. import tornado.httpserver
  4. import tornado.ioloop
  5. import tornado.options
  6. import tornado.web
  7. from tornado.options import define, options
  8. define("port", default=8000, help="run on the given port", type=int)
  9. class Application(tornado.web.Application):
  10. def __init__(self):
  11. handlers = [
  12. (r"/", MainHandler),
  13. ]
  14. settings = dict(
  15. template_path=os.path.join(os.path.dirname(__file__), "templates"),
  16. static_path=os.path.join(os.path.dirname(__file__), "static"),
  17. debug=True,
  18. )
  19. tornado.web.Application.__init__(self, handlers, **settings)
  20. class MainHandler(tornado.web.RequestHandler):
  21. def get(self):
  22. self.render(
  23. "index.html",
  24. title = """Preservation of three-dimensional anatomy in phosphatized
  25. fossil arthropods enriches evolutionary inference""",
  26. author = """Achim H Schwermann, Tomy dos Santos Rolo, Michael S Caterino,
  27. Günter Bechly, Heiko Schmied, Tilo Baumbach, Thomas van de Kamp""",
  28. institute = """Steinmann Institute for Geology, Mineralogy and Paleontology,
  29. University of Bonn, Bonn, Germany; ANKA/Institute for Photon Science and
  30. Synchrotron Radiation, Karlsruhe Institute of Technology, Eggenstein-Leopoldshafen,
  31. Germany; Department of Agricultural and Environmental Sciences, Clemson University,
  32. Clemson, United States; State Museum of Natural History Stuttgart, Stuttgart,Germany;
  33. Institute of Crop Science and Resource Conservation, University of Bonn, Bonn, Germany;
  34. Laboratory for Applications of Synchrotron Radiation, Karlsruhe Institute of Technology,
  35. Karlsruhe, Germany"""
  36. )
  37. if __name__ == "__main__":
  38. tornado.options.parse_command_line()
  39. http_server = tornado.httpserver.HTTPServer(Application())
  40. http_server.listen(options.port)
  41. tornado.ioloop.IOLoop.instance().start()