Flask tutorial from http://blog.miguelgrinberg.com/