How to pass a variable between Flask pages?

后端 未结 2 1175
广开言路
广开言路 2020-11-22 04:19

Suppose I have following case;

@app.route(\'/a\', methods=[\'GET\'])
def a():
  a = numpy.ones([10,10])
  ...
  return render_template(...) # this rendered p         


        
2条回答
  •  无人及你
    2020-11-22 04:52

    The link to route /b in the template for /a could have query parameters added to it, which you could read in the route for /b. Alternatively you could store the value for a in a session variable to access it between views.

提交回复
热议问题