Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Python by (47.6k points)

Not obvious from the flask documentation on how to get the query string. I am new, looked at the docs, could not find!

So

@app.route('/')

@app.route('/data')

def data():

query_string=??????

return render_template("data.html")

1 Answer

0 votes
by (106k points)

To get a query string on Flask you can use the following piece of code:-

from flask import request

@app.route('/data')

def data():

   user = request.args.get('user')

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 30, 2019 in Python by Eresh Kumar (45.3k points)
0 votes
1 answer
0 votes
1 answer
asked Jul 2, 2020 in Python by Sudhir_1997 (55.5k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...