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 and open a browser at, you would notice a message, ‘It Works!’ which suggests Tornado Web Server is up and running.
  • On browsing to (HTTP GET), you would notice message ‘Page on articles’ with a button ‘Home’.
  • Button ‘Home’ is a html file that submits a Post request on ‘/article’ page. Class Article  handles this HTTP POST request and redirects itself to home page(‘/’).

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s