Check out example codes for "two buttons on html page flask". It will help you in understanding the concepts better.

Code Example 1

<input type="submit" name="submit_button" value="Do Something">
<input type="submit" name="submit_button" value="Do Something Else">
def contact():
    if request.method == 'POST':
        if request.form['submit_button'] == 'Do Something':
            pass # do something
        elif request.form['submit_button'] == 'Do Something Else':
            pass # do something else
        else:
            pass # unknown
    elif request.method == 'GET':
        return render_template('contact.html', form=form)

Code Example 2

<form method ="post" action="/">
  <button type="submit" name="submit_a" value="submit_a"> Submit_a </button>
  <button type="submit" name="submit_b" value="submit_b"> Submit_b </button>
</form> 



def submit(): 
	if request.method == "POST":
		if request.form.get("submit_a"):
			# do something
		elif request.form.get("submit_b"):
			# do something else
	elif request.method == "GET":
			# do something

Learn ReactJs, React Native from akashmittal.com