我有一个获取数据并重定向到bk.html页面的表单。我想从提交的表单中得到结果,并让页面重定向到上面的信息。我可以动态地将它放在同一个页面上,但我不知道如何将它添加到新页面。from flask import Flask, render_template, request, redirect
app = Flask(__name__)
# our index route will handle rendering our form
@app.route('/')
def index():
return render_template("index.html")
@app.route('/users', methods=['POST'])
def create_user():
print "Got Post Info"
name = request.form['name']
DojoLocation = request.form['location']
FavoriteLanguage = request.form['Language']
textarea = request.form['textarea']
# redirects back to the '/' route
return render_template('bk.html')
app.run(debug=True) # run our server
Dojo Survey IndexName:
Dojo Location:
Silicon Valley
Seattle
Los Angeles
Dallas
Washington DC
Dallas
Chicago
Berkely
Orange County
Favorite Language:
ios swift
ruby on rails
Python
Mean
C# DC