UndefinedError: 'admin_base_template' is undefined - Flask Admin
This happens when you try to render a template like this:return render_template('admin/upload.html')
You need to use self.render instead:
return self.render('admin/upload.html')
You can either find the columns by calling result.keys() or you can access them through calling v.keys() inside the for loop.
Here's an example using items():
for v in result:
for column, value in v.items():
print('{0}: {1}'.format(column, value))