当我使用post方法向python flask提交一次时,我的网页被渲染了多次

时间:2020-02-08 07:03:26

标签: python html flask

@app.response("/process" , methods=['POST'])
def process():
    return render_template('index.html')
  1. 请在这里找到我的问题的解决方案,即使用python flask和html

1 个答案:

答案 0 :(得分:0)

根据您提供的内容,这是我能想到的唯一解决方案。如果这不是您想要的,请随时提问,谢谢!

from Flask import request

@app.response("/process" , methods=['POST'])
def process():
    if (request.method == "POST"):
        <enter code here>
    else:
        return render_template('index.html')