0
是否可以用Flask重写一个URL例如如果通过这条路线被接收的POST请求:用Flask重写一个URL
@app.route('/', methods=['GET','POST'])
def main():
if request.method == 'POST':
#TODO: rewrite url to something like '/message'
return render_template('message.html')
else:
return render_template('index.html')
我知道我可以使用重定向和安装另一条路线,但我更喜欢,如果可以简单地修改URL。
你的意思是你想改变URL信息在你得到这个职位信息? – 2015-03-25 09:45:21
我曾希望能够更改用户在浏览器栏中看到的URL。这只能在客户端完成,例如与JS或Flask重定向? – 2015-03-25 09:50:11