for book The Flask Mega-Tutorial by Miguel Grinberg