Video description
Get started with the Flask framework by building six interesting applications
About This Video
- Get to grips with the framework of Flask and its extensions
- Discover the process of building and deploying Python-based web applications using Flask
- Learn how to use Flask extensions to make your applications more powerful
In Detail
Many developers, and even beginners, opt for the Flask framework to build web applications because of its easy-to-understand and well-defined framework. This course will show you how to use the Flask framework's power and its extensions to build powerful and robust web applications.
The course starts by taking you through the process of setting up the Flask environment on your machines. Next, you will understand the Flask basics and templates and learn how to create and connect to a database. In the rest of the course, you will build six interesting Python web applications to dive deep into the concepts of the Flask framework.
By building these applications, you will learn how to create and connect the applications to databases, how to use Flask to process incoming request data, how to build an API with Flask, how to handle user sessions, and how to deploy applications to a server. In addition to this, you will also cover popular Flask extensions, such as Flask-SQLAlchemy, Flask-Bootstrap, Flask-Babel, and learn how these extensions add powerful functionalities to your applications.
By the end of this course, you will be well-versed in the Flask framework and extensions and will have gained the skills to build real-world applications.
Who this book is for
If you are a beginner or an experienced Python developer, who is looking to learn Flask to develop Python web-based applications, this course is for you. Basic knowledge of Python is needed to get started with this course, and prior knowledge of HTML would be an added advantage.
Publisher resources
Table of contents
- Chapter 1 : Flask Basics
- Chapter 2 : Templates
- Chapter 3 : Database
-
Chapter 4 : Food Tracker Application
- Demo
- Initial HTML Files
- Adding Templates
- Creating the Database
- Adding Database Helpers
- Working with the Food Form
- Inserting Food Data into the Database
- Displaying All Foods in the Database
- Inserting the Date
- Querying All Dates
- Day Screen
- Adding Food to the Database
- Getting a List of Foods for the Day
- Getting Food Totals for the Day
- Links
- Calculating Totals Per Day
- Adding Links
- Refactoring
- Setting Up Deployment Server on Amazon Lightsail
- Deploying to Amazon Lightsail Server
- Errata
-
Chapter 5 : Question and Answer Application
- Demo
- Overview of Templates
- Install and Templates
- Database Helpers
- Creating the Database
- Registering a User
- Logging In
- Sessions
- Common User Functions
- Updating Links
- Creating Test Users
- User Setup Page
- Creating a Question
- Listing Questions
- Answering Question
- Home Route Questions
- Question Page
- Preventing Duplicate Users
- Protecting Routes
- Protecting Routes by Role
- Login Failure Messages
- Formatting Queries
- Added Link Macro
- Base Template
- Deploying to Heroku
- Converting to Postgres
- Static Secret Key on Heroku
- Chapter 6 : Member API
-
Chapter 7 : Flask-SQLAlchemy
- Setting Up a Database and Determining the URI
- Installing Flask-SQLAlchemy
- Connecting to the Database
- Creating a Table
- Inserting Data
- Updating Data
- Deleting Data
- Introduction to Queries
- Generative Queries
- Not Equals and Like
- In and Not In
- Null and Not Null
- And
- Or
- Order By
- Limit
- Offset
- Count
- Inequality
- One-to-Many Relationship
- One-to-Many Queries
- Many-to-Many Relationships
- Many-to-Many Queries
-
Chapter 8 : Flask-WTF
- Installing and Setting Up Flask-WTF
- Creating a Form
- Submitting the Form
- Validators
- More Fields
- Adding an Extra Validator
- Changing Labels and Defaults
- Prepopulating Data
- Populating Obj
- More on CSRF
- Jinja Macro
- Form Inheritance
- Field Enclosures
- Field List
- Deleting Field
- Dynamic Forms
- Note on JavaScript AJAX
- Recaptcha Field
- Inline Validators
- Information on Other Fields and Validators
- Date Fields
- Flask-WTF Example
- Flask-WTF with Flask-Bootstrap
- Chapter 9 : Flask-Bootstrap
- Chapter 10 : Flask-Mail
- Chapter 11 : Flask-Migrates
- Chapter 12 : Flask-Uploads
- Chapter 13 : Flask-Login
-
Chapter 14 : Flask-Admin
- Installing and Setting Up Flask-Admin
- Adding User View
- Viewing Table with Multiple Columns
- Tables with Relationships
- Removing a Column from the View
- Displaying Primary Key Column
- Enabling/Disabling, Creating, Editing, and Deleting
- Exporting Table Data
- Creating a Modal
- Other Attributes
- Using on_model_change to Automatically Hash a Password
- File Admin
- Modifying the Home Template
- Modifying Other Views
- Creating a New View
- URL For
- Inline Models
- Authentication for Views
- Adding Flask-Login
- Chapter 15 : Flask-User
- Chapter 16 : Flask-Babel
-
Chapter 17 : Flask-Restless
- Installing Flask-Restless
- Setting Up Models
- Creating a Database
- Integrating Flask-Restless
- GET Requests
- GET Specific Items
- POST Requests
- DELETE Requests
- PUT Requests
- Limit
- Offset
- Order By
- Searching Queries
- In and Not In Operators
- Is Null and Is Not Null Operators
- Like Operator
- Or Queries
- Any Operator
- Has Operator
- Deleting with Queries
- Patching with the Queries Bug
- Pagination
-
Chapter 18 : Flask-SocketIO
- Installing and Setting Up Flask-SocketIO
- Setting Up JavaScript Client
- Sending Messages from Client to Server
- Sending Messages from Server to Client
- Emitting Custom Events
- Sending and Receiving JSON
- Multiple Clients
- Broadcasting Messages
- Server Initiated Events
- Namespaces
- Session IDs
- Sending Private Message
- Joining a Room
- Leaving a Room
- Closing a Room
- Connecting and Disconnecting
- Chapter 19 : Flask-Security
-
Chapter 20 : Engage! A Twitter Clone
- Overview of Templates
- Creating Routes with Templates
- Converting Static Resources
- Preparing Flask-Migrate and Flask-SQLAlchemy
- Creating an SQLite Database
- Adding User Model and Creating a Table
- Creating the Register Form
- Converting the Register Form to WTForm
- Testing the Register Form
- Adding Error Messages to the Register Form
- Handling the Profile Image Upload
- Saving the Registration Data to the Database
- Creating the Login Form
- Creating the Login Route
- Finishing the Login Form
- Displaying the Profile Information
- Creating Tweet Model and Migrating
- Creating a Tweet Form
- Updating the Timeline to Be Dynamic
- Adding Time Since the Creation of a Tweet
- First Refactor
- Timeline Image and Total Tweets
- General Timeline Page
- Making a Profile General
- Follower Model
- Adding a Follow Route
- Updating the Follower Count and List of Followers
- Creating a Follow Link
- Testing the Follow Link
- Updating the Timeline Page
- Adding Links to User Profiles
- Who to Watch Section?
- Adding User Timeline Links
- Refactoring HTML
- Refactoring Navigation
- Making Navigation Links Dependent on Login Status
- Updating the Timeline Follower Count and Changing the Homepage
- Refactoring Views
- Refactor Register Template
- Conclusion
-
Chapter 21 : Store Application
- Initial Files
- Adding the Product Table
- Creating the Add Product Form
- Adding Products to the Database
- Admin Dashboard Product List
- Showing the Dollar Amount and Product Counts
- Adding Products to the Homepage
- The Product Page
- Adding Products to the Cart
- The Cart Session
- Displaying Items in the Cart
- Removing Items from Cart
- Creating the Order Tables
- Creating the Checkout Form – Part 1
- Checkout Form - Part 2
- Checkout Form - Part 3
- Randomizing the Reference
- Checkout Screen Cart Details
- Managing Pending Orders
- Calculating the Order Total
- Order Screen
- Updating the Stock Totals
-
Chapter 22 : Forum Application
- Overview of the Forum Application
- Setting Up the Flask-Security Models
- Setting Up the Register Page
- Setting Up a User
- Login Screen
- Thread Model
- Saving the Thread Form to the Database
- Displaying Threads from the Database
- Updating the Thread Model to Include the Date
- Thread Page
- Creating the Reply Model
- Handling Replies
- Adding the Last Post's Date
- The Profile Page
- Adding Links and Wrap Up
- Chapter 23 : Weather Application
Product information
- Title: The Ultimate Flask Course
- Author(s):
- Release date: September 2019
- Publisher(s): Packt Publishing
- ISBN: 9781839219924
You might also like
book
40 Algorithms Every Programmer Should Know
Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental …
book
Flask Framework Cookbook - Second Edition
Build state-of-the-art web applications quickly and efficiently using Flask and related technologies with Python 3 Key …
book
Tiny Python Projects
The projects are tiny, but the rewards are big: each chapter in Tiny Python Projects challenges …
book
Software Engineering at Google
Today, software engineers need to know not only how to program effectively but also how to …