Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (30 sloc) 1008 Bytes
from bottle import run, route, request, get, post, static_file, redirect
from gluino import wrapper, DAL, Field, SQLFORM, cache, IS_NOT_EMPTY
import time
# configure the gluino wrapper
wrapper.debug = True
wrapper.redirect = lambda status,url: redirect(url)
# create database and table
# define action
def index():
vars = wrapper.extract_vars(request.forms)
form = SQLFORM(db.person)
if form.accepts(vars):
message = 'hello %s' %
message = 'hello anonymous'
people = db(db.person).select()
now = cache.ram('time',lambda:time.ctime(),10)
return locals()
# handle static files
def server_static(filename):
return static_file(filename, root='static')
#start web server
if __name__=='__main__':
run(host='localhost', port=8080)
Jump to Line
Something went wrong with that request. Please try again.