更新时间:2023-02-23 22:42:15
可以使用request.view_args
.
文档对此定义如下:
It's possible to use request.view_args
.
The documentation defines it this way:
与请求匹配的视图参数字典.
A dict of view arguments that matched the request.
这是一个例子:
@app.route("/data/<section>")
def data(section):
assert section == request.view_args['section']