server.py example render

import tornado.template import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): items = ["Item 1", "Item 2", "Item 3", "{{2*3}}"] self.render("template.html", title="My title", items=items) application = tornado.web.Application([ (r"/", MainHandler), ], debug=True, static_path=None, template_path=None) if __name__ == '__main__': application.listen(8000) tornado.ioloop.IOLoop.instance().start()
server.py for example render

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.