This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import os | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.web | |
| class StreamHandler(tornado.web.RequestHandler): | |
| @tornado.web.asynchronous | |
| def get(self): | |
| #self.set_header("Content-Type", "application/ogg+ogg") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import tornado.httpclient | |
| import tornado.ioloop | |
| import gevent | |
| def on_complete(data): | |
| print data.body[0:10] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import tornado.httpclient | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.web | |
| class MainHandler(tornado.web.RequestHandler): | |
| @tornado.web.asynchronous | |
| def get(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.web | |
| import tornado.httpclient | |
| from tornado.testing import AsyncHTTPTestCase | |
| class MainHandler(tornado.web.RequestHandler): | |
| @tornado.web.asynchronous |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/env python | |
| execfile('./htdocs/reviewboard.wsgi') | |
| from tornado.options import options, define, parse_command_line | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.web | |
| import tornado.wsgi | |
| define('port', type=int, default=8080) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <title> | |
| JSON Example | |
| </title> | |
| <body> | |
| <FORM ACTION="/blog" METHOD=POST> | |
| Title: <input type="text" name="title"> | |
| Author: <input type="text" name="author"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import tornado.wsgi | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| from Pyblosxom.pyblosxom import PyBlosxomWSGIApp | |
| container = tornado.wsgi.WSGIContainer(PyBlosxomWSGIApp()) | |
| http_server = tornado.httpserver.HTTPServer(container) |