Bottle is one of the lightest python micro-frameworks for making websites. To handle a form submission, first import the request class from bottle.

from bottle import request 

Add allowed request method on the desired route and access the form data. An example is below.

 @route('/submit/form', method='POST')
def handle_form_submit():
title = request.forms.get('title')
body = request.forms.get('body')
#handle form data as desired here
redirect('/')

That is all. Check out other bottle tutorials if you are interested.

Categories: Bottle

Leave a Reply

Your email address will not be published. Required fields are marked *