
与路由参数不匹配的所有参数都将添加为查询字符串。假设
extra_args是一个命令,只需解压缩它即可。
extra_args = {'hello': 'world'}url_for('doit', oid=oid, **extra_args)# /doit/123?hello=worldurl_for('doit', oid=oid, hello='davidism')# /doit/123?hello=davidism然后使用以下命令在视图中访问它们
request.args:
@app.route('/doit/<int:oid>')def doit(oid) hello = request.args.get('hello') ...欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)