Tornado – Static File Handler

Trouble accessing favicon or css or other web page images with Tornado? Well here's the solution. Tornado provides tornado.web.StaticFileHandler construct that helps the web server locate images or icon files to be served while loading the web page. Here's an example https://gist.github.com/3205067.js In this example, articles.html is loading images/images.jpg. Path images/* is understood by Tornado … Continue reading Tornado – Static File Handler

Tornado – Redirection

Redirections are essential while developing a website. What if you need to redirect a user from a page to home page based on an event? Tornado supports redirection. In the example below, When you run tornadoredirection.py and open a browser at http://127.0.0.1:8888, you would notice a message, 'It Works!' which suggests Tornado Web Server is … Continue reading Tornado – Redirection