Friday, June 22, 2018

javascript - Post in flask does not render new template

Let's say I have this setup


Why after clicking "arrToPython" button flask does not redirect me to "query_result.html"? And more importantly, how can I make it to do so?


I tried creating separate route like and using flask's "redirect" method, but it did not work for me either :(
test.py:


from flask import Flask
from flask import request, url_for
from flask import render_template
from flask import redirect, Response
app = Flask(__name__)
@app.route('/', methods=['POST', 'GET'])
def savingImage():
if request.method == 'GET':
return render_template('test.html')
if request.method == 'POST':
return render_template('query_result.html')
if __name__ == '__main__':
app.debug = True
app.run()

Where test.html


  





And query_result.html



Hola amigo!

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...