flaskr from http://flask.pocoo.org/docs/