您好,欢迎访问一九零五行业门户网

Python使用Flask框架获取当前查询参数的方法

本文实例讲述了python使用flask框架获取当前查询参数的方法。分享给大家供大家参考。具体如下:
这段代码实现python的flask框架下获取当前查询参数,即querystring中的所有参数
from flask import flask, render_template, request# initialize the flask applicationapp = flask(__name__)# this is a catch all route, to catch any request the user does@app.route('/')def index(): qs = request.query_string return render_template('index.html', query_string=qs)if __name__ == '__main__': app.run( host=0.0.0.0, port=int(80), )
希望本文所述对大家的python程序设计有所帮助。
其它类似信息

推荐信息