I am trying to create a VERY basic webpage whose entire purpose is to hold buttons. When those buttons are pressed, I need it to send a message to the backend/server/main script with the same text as the button.
For example, I have a list with a bunch of names, I use jinja templates to create a button for each name. When that button is pushed, I need that name to be sent to the backend. The list will change, so I can't do static pages for each one.
This is my first attempt, the buttons are created, but I cannot figure out how to send the action back
incentivesInteractive = []
# # # Flask
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def main():
if request.method == 'POST':
print('test')
return render_template('control.html',items=incentives)```