Flask By Example

Unleash the full potential of the Flask web framework by creating simple yet powerful web applications
Preview in Mapt

Flask By Example

Gareth Dwyer

1 customer reviews
Unleash the full potential of the Flask web framework by creating simple yet powerful web applications
Mapt Subscription
FREE
$29.99/m after trial
eBook
$19.60
RRP $27.99
Save 29%
Print + eBook
$34.99
RRP $34.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$19.60
$34.99
$29.99 p/m after trial
RRP $27.99
RRP $34.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Flask By Example Book Cover
Flask By Example
$ 27.99
$ 19.60
Julia 1.0 By Example Book Cover
Julia 1.0 By Example
$ 39.99
$ 28.00
Buy 2 for $35.00
Save $32.98
Add to Cart

Book Details

ISBN 139781785286933
Paperback276 pages

Book Description

This book will take you on a journey from learning about web development using Flask to building fully functional web applications. In the first major project, we develop a dynamic Headlines application that displays the latest news headlines along with up-to-date currency and weather information. In project two, we build a Crime Map application that is backed by a MySQL database, allowing users to submit information on and the location of crimes in order to plot danger zones and other crime trends within an area. In the final project, we combine Flask with more modern technologies, such as Twitter's Bootstrap and the NoSQL database MongoDB, to create a Waiter Caller application that allows restaurant patrons to easily call a waiter to their table. This pragmatic tutorial will keep you engaged as you learn the crux of Flask by working on challenging real-world applications.

Table of Contents

Chapter 1: Hello, World!
Introducing Flask
Creating our development environment
Writing "Hello, World!"
Deploying our application to production
Summary
Chapter 2: Getting Started with Our Headlines Project
Setting up our project and a Git repository
Creating a new Flask application
Introduction to RSS and RSS feeds
Summary
Chapter 3: Using Templates in Our Headlines Project
Introducing Jinja
Basic use of Jinja templates
Advanced use of Jinja templates
Summary
Chapter 4: User Input for Our Headlines Project
Getting user input using HTTP GET
Getting user input using HTTP POST
Adding weather and currency data
Summary
Chapter 5: Improving the User Experience of Our Headlines Project
Adding cookies to our Headlines application
Adding CSS to our Headlines application
Summary
Chapter 6: Building an Interactive Crime Map
Setting up a new Git repository
Understanding relational databases
Installing and configuring MySQL on our VPS
Creating our Crime Map database in MySQL
Creating a basic database web application
Summary
Chapter 7: Adding Google Maps to Our Crime Map Project
Running a database application locally
Adding an embedded Google Maps widget to our application
Adding an input form for new crimes
Displaying existing crimes on our map
Summary
Chapter 8: Validating User Input in Our Crime Map Project
Choosing where to validate
Trying out an XSS example
Validating and sanitizing
Summary
Chapter 9: Building a Waiter Caller App
Setting up a new Git repository
Using Bootstrap to kick-start our application
Adding user account control to our application
Summary
Chapter 10: Template Inheritance and WTForms in Waiter Caller Project
Adding the Account and Dashboard pages
Shortening URLs using the bitly API
Adding functionality to handle attention requests
Adding user feedback with WTForms
Summary
Chapter 11: Using MongoDB with Our Waiter Caller Project
Introducing MongoDB
Installing MongoDB
Using the MongoDB shell
Introducing PyMongo
Testing our application in production
Adding some finishing touches
Summary

What You Will Learn

  • Build three web applications from the ground up using the powerful Python micro framework, Flask.
  • Dynamically display data to your viewers, based on their requests
  • Store user and static data in SQL and NoSQL databases and use this data to power your web applications
  • Create a good user experience by combining HTML, CSS, and JavaScript
  • Harness the convenience of freely available APIs, including OpenWeatherMap, Open Exchange Rates, and bitly
  • Extend your applications to build advanced functionality, such as a user account control system using Flask-Login
  • Learn about web application security and defend against common attacks, such as SQL injection and XSS

Authors

Table of Contents

Chapter 1: Hello, World!
Introducing Flask
Creating our development environment
Writing "Hello, World!"
Deploying our application to production
Summary
Chapter 2: Getting Started with Our Headlines Project
Setting up our project and a Git repository
Creating a new Flask application
Introduction to RSS and RSS feeds
Summary
Chapter 3: Using Templates in Our Headlines Project
Introducing Jinja
Basic use of Jinja templates
Advanced use of Jinja templates
Summary
Chapter 4: User Input for Our Headlines Project
Getting user input using HTTP GET
Getting user input using HTTP POST
Adding weather and currency data
Summary
Chapter 5: Improving the User Experience of Our Headlines Project
Adding cookies to our Headlines application
Adding CSS to our Headlines application
Summary
Chapter 6: Building an Interactive Crime Map
Setting up a new Git repository
Understanding relational databases
Installing and configuring MySQL on our VPS
Creating our Crime Map database in MySQL
Creating a basic database web application
Summary
Chapter 7: Adding Google Maps to Our Crime Map Project
Running a database application locally
Adding an embedded Google Maps widget to our application
Adding an input form for new crimes
Displaying existing crimes on our map
Summary
Chapter 8: Validating User Input in Our Crime Map Project
Choosing where to validate
Trying out an XSS example
Validating and sanitizing
Summary
Chapter 9: Building a Waiter Caller App
Setting up a new Git repository
Using Bootstrap to kick-start our application
Adding user account control to our application
Summary
Chapter 10: Template Inheritance and WTForms in Waiter Caller Project
Adding the Account and Dashboard pages
Shortening URLs using the bitly API
Adding functionality to handle attention requests
Adding user feedback with WTForms
Summary
Chapter 11: Using MongoDB with Our Waiter Caller Project
Introducing MongoDB
Installing MongoDB
Using the MongoDB shell
Introducing PyMongo
Testing our application in production
Adding some finishing touches
Summary

Book Details

ISBN 139781785286933
Paperback276 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Flask: Building Python Web Services Book Cover
Flask: Building Python Web Services
$ 79.99
$ 56.00
Building RESTful Python Web Services Book Cover
Building RESTful Python Web Services
$ 39.99
$ 28.00
Modern Python Cookbook Book Cover
Modern Python Cookbook
$ 39.99
$ 28.00
Django: Web Development with Python Book Cover
Django: Web Development with Python
$ 67.99
$ 47.60
Learning PHP 7 Book Cover
Learning PHP 7
$ 39.99
$ 8.00
Mastering Django: Core Book Cover
Mastering Django: Core
$ 39.99
$ 28.00