Following Miguel Grinberg's excellent tutorial for flask.