美文网首页
Python Flask框架下获取当前查询参数的源码

Python Flask框架下获取当前查询参数的源码

作者: 联联小子 | 来源:发表于2020-06-10 09:49 被阅读0次

把写代码过程中比较好的代码段珍藏起来,如下代码段是关于Python Flask框架下获取当前查询参数的的代码。

from flask import Flask, render_template, request

# Initialize the Flask application

app = Flask(__name__)

@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 Flask框架下获取当前查询参数的源码

      本文链接:https://www.haomeiwen.com/subject/vldutktx.html