flask 发送ajax

前端




    
    Title




后端



from flask import Flask,request,render_template,redirect

app = Flask(__name__)


@app.route('/',methods=['GET','POST'])
def test():
    if request.method == "GET":
        return render_template('01.html')
    print('1111')
    print(request.form.get('psm'))
    return redirect('https://www.baidu.com')



if __name__ == '__main__':
    app.run()

你可能感兴趣的:(flask,ajax,python)