def get(self): db = DBUtil('Info.db', 'information') data = json.dumps(db.getUsers()) with open('data.json', 'w+') as outfile: json.dump(data, outfile) db.close() self.render('show.html')
def post(self): name = self.get_argument('name') age = int(self.get_argument('age')) city = self.get_argument('city') db = DBUtil('Info.db', 'information') db.insert(name, age, city) db.close() self.redirect('/insert')