import web db web database dbn sqlite db test db render web template r

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import web
db = web.database(dbn='sqlite', db='test.db')
render = web.template.render('templates/')
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(self, name):
links = db.select('links')
return render.index(links)
if __name__ == "__main__":
app.run()