#!/usr/bin/env python import web, config, view from view import render urls = ( '/', 'index', '/add', 'add' ) class index: def GET(self): todos = web.select('todo') print render.index(todos) #print render.base(view.listing()) class add: def POST(self): i = web.input() if i.title: n = web.insert('todo', title=i.title) web.seeother('./#t'+str(n)) else: web.seeother('./') if __name__ == "__main__": #web.wsgi.runwsgi = web.wsgi.runfcgi # force to run as Fast CGI web.run(urls, globals(), *config.middleware)