flask tutorial from http://flask.pocoo.org/docs/tutorial/setup/#tutorial-setup