Tornado – Autoreload

One of the most irritating (i would say) things about web development is about restarting your web server whenever there's a change in the code base or the template files to test if the development change has been propagated correctly... If you're a web developer you know exactly about the agony I'm referring to... Well, … Continue reading Tornado – Autoreload

Tornado – Options

You must have observed, all this while we have written tornado based applications that listen on port 8888, and in MySQL post, we had predefined our database connection details (like server, username, password etc). But what if we need to change these details based on modules or applications or configurations? Tornado, provides this with a … Continue reading Tornado – Options

Tornado – Escape – URLs

Like that for JSON strings, Tornado also provides methods for escaping and unescaping URLs. Not just that, it also exports some methods to play with URLs. Let's see the behavior with the example below https://gist.github.com/3487940 1. tornado.escape.linkify(text) - creates a link for provided text 2. tornado.escape.linkify(text, shorten=Tue) - creates a link and shortens the URL … Continue reading Tornado – Escape – URLs

Tornado – Blocking & Non-Blocking HTTP Client

Tornado provides tornado.httpclient that works as httpclient and can send blocking and non-blocking (async) http requests. tornado.httpclient.HTTPClient 1. HTTPClient: This tornado client is typically used for testing web servers or simply making a HTTP request and receiving the response. An example implementation below https://gist.github.com/3394444 tornado.httpclient.AsyncHTTPClient 2. AsyncHTTPClient: httpclient.AsyncHTTPClient()  creates an instance of the class and … Continue reading Tornado – Blocking & Non-Blocking HTTP Client

Tornado – Asynchronous Requests

Tornado is a non-blocking I/O web server. In Tornado, when the request handler serves the request made by the client, the request is closed by itself. Python decorator @tornado.web.asynchronous can be used to override the default behavior (of automatically finishing the request) and keep the request open. So, its the duty of the server developer … Continue reading Tornado – Asynchronous Requests