Flask 重定向(urlfor())为什么不起作用?

Flask redirect(urlfor()) doesn't work why?

@app.route('/result',methods=['GET','POST'])

def result(res):

    return render_template('public/inherit.html',res=res)

@app.route('/',methods=["POST","GET"])

def index():

    if request.method == "POST":
        a = 12
        redirect(url_for('result',res=a))
    return render_template('public/index.html'

index.html

    <form method="post" action="{{ url_for('index') }}">
        <input type="submit" name="Login" value="Submit">
    </form>

inherit.html

<p>{{ res }}<p>

改变

@app.route('/result',methods=['GET','POST'])

@app.route('/result/<res:int>',methods=['GET','POST'])