pip install pydblite
pip install web.py
python
import web
from pydblite import Base
urls = (
'/', 'index',
'/add', 'add_entry',
)
render = web.template.render('templates/')
db = Base('mydatabase.db')
db.create('name', 'age', 'email')
db.open()
class index:
def GET(self):
return render.index(entries)
class add_entry:
def POST(self):
data = web.input()
db.insert(name=data.name, age=data.age, email=data.email)
raise web.seeother('/')
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()