Migrating to flask from web.py