Python USES the Flask framework to obtain the current query parameters

  • 2020-04-02 14:43:34
  • OfStack

This example demonstrates how Python USES the Flask framework to obtain the current query parameters. Share with you for your reference. The details are as follows:

This code implements Python's Flask framework to get the current query parameters, that is, all the parameters in the QueryString


from flask import Flask, render_template, request
# Initialize the Flask application
app = 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"),
  )

I hope this article has helped you with your Python programming.


Related articles: