Changed from web.py to Flask