Skip to Content
Flask Framework Cookbook - Second Edition
book

Flask Framework Cookbook - Second Edition

by Shalabh Aggarwal
July 2019
Beginner to intermediate
302 pages
9h 38m
English
Packt Publishing
Content preview from Flask Framework Cookbook - Second Edition

How it works...

Now, if we open the http://127.0.0.1:5000/hello URL in a browser, we should see a response similar to the one shown in the following screenshot:

If we pass a URL argument with the user key as http://127.0.0.1:5000/hello?user=John, we should see the following response:

As we can see in views.py, the argument passed in the URL is fetched from the request object using request.args.get('user') and then passed to the context of the template being rendered using render_template. The argument is then parsed using the Jinja2 placeholder, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Writing a Web Application with Flask

Writing a Web Application with Flask

Doug Farrell
Mastering Flask

Mastering Flask

Jack Stouffer

Publisher Resources

ISBN: 9781789951295Supplemental Content