Flask - 从函数中获取路径URL

时间:2012-11-19 03:49:54

标签: python flask

@app.route('/this/is/the/url')
def some_exposed_func():
    return render_template("data.html")

如何从 some_exposed_func 句柄获取'/ this / is / the / url'?

print 'The func URL is: %s' % get_flask_route_url(some_exposed_func)

1 个答案:

答案 0 :(得分:6)

找到我自己: url_for()就是答案