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 – Json

Tornado web server exports methods for escape/unescape html, xml, Json among others. This blog discusses about encoding and decoding JSON format. Tornado has the following methods: tornado.escape.json_encode(value) - JSON'ify the Python object passed to it as argument tornado.escape.json_decode(value) - Converts the JSON string into Python Object Here's a usage example: In this example, 1. … Continue reading Tornado – Escape – Json

Tornado – SQLite

I received a couple of requests for Tornado's interaction with SQLite interface. So, here's the blog... SQLite is a file based and transactional database engine. Because of it's lightweight capabilities, SQLite's adoption has increased in the recent past. You can know more about it here. Below is an example of Tornado's interaction with SQLite DB. … Continue reading Tornado – SQLite

Tornado – Internationalization

  Web development often calls for internationalization (i18n), Tornado provides this facility with tornado.locale class. In the example below, we create request handlers to cater to users request for different locale. For instance, DEHandler renders a standard web page (locale_template.html) in German language after translating the English words from the template. Translation is governed … Continue reading Tornado – Internationalization