The following line
raise web.redirect('/%s') % word
should be changed to
raise web.seeother('/%s' % word)
- You have to use
%
on string, notweb.redirect
result. - I think
web.seeother
should be used instead ofweb.redirect
, because the latter returns301 Moved Permanently
redirect and I don't think you need permanent redirect here.