Answer the question
In order to leave comments, you need to log in
How to handle two different ajax requests in one flask function?
when one button is pressed, a request is made with data :
@app.route('/admin', methods=['POST', 'GET'])
def admin_page():
if request.method == 'POST':
link = request.form['link']
industry = request.form['industry']
result = jsonify(parser(link, industry))
return result
else:
return render_template("admin.html")
@app.route('/admin', methods=['POST', 'GET'])
def admin_page():
if request.method == 'POST':
data = request.form['data']
else:
return render_template("admin.html")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question