Autoplay
Autocomplete
Previous Lesson
Complete and Continue
The New and Improved Flask Mega-Tutorial: Ebook Edition
Ebook Downloads
The Flask Mega-Tutorial Ebook Downloads
Preface
Preface
Chapter 1: Hello, World!
Introduction
1.1 Installing Python
1.2 Installing Flask
1.3 A "Hello, World" Flask Application
Chapter 2: Templates
Introduction
2.1 What Are Templates?
2.2 Conditional Statements
2.3 Loops
2.4 Template Inheritance
Chapter 3: Web Forms
Introduction
3.1 Introduction to Flask-WTF
3.2 User Login Form
3.3 Form Templates
3.4 Form Views
3.5 Receiving Form Data
3.6 Improving Field Validation
3.7 Generating Links
Chapter 4: Database
Introduction
4.1 Databases in Flask
4.2 Database Migrations
4.3 Flask-SQLAlchemy Configuration
4.4 Database Models
4.5 Creating the Migration Repository
4.6 The First Database Migration
4.7 Database Upgrade and Downgrade Workflow
4.8 Database Relationships
4.9 Playing with the Database
4.10 Shell Context
Chapter 5: User Logins
Introduction
5.1 Password Hashing
5.2 Introduction to Flask-Login
5.3 Preparing the User Model for Flask-Login
5.4 User Loader Function
5.5 Logging Users In
5.6 Logging Users Out
5.7 Requiring Users to Login
5.8 Showing the Logged In User in Templates
5.9 User Registration
Chapter 6: Profile Page and Avatars
Introduction
6.1 User Profile Page
6.2 Avatars
6.3 Using Jinja2 Sub-Templates
6.4 More Interesting Profiles
6.5 Recording The Last Visit Time For a User
6.6 Profile Editor
Chapter 7: Error Handling
Introduction
7.1 Error Handling in Flask
7.2 Debug Mode
7.3 Custom Error Pages
7.4 Sending Errors by Email
7.5 Logging to a File
7.6 Fixing the Duplicate Username Bug
Chapter 8: Followers
Introduction
8.1 Database Relationships Revisited
8.2 Representing Followers
8.3 Database Model Representation
8.4 Adding and Removing "follows"
8.5 Obtaining the Posts from Followed Users
8.6 Combining Own and Followed Posts
8.7 Unit Testing the User Model
8.8 Integrating Followers with the Application
Chapter 9: Pagination
Introduction
9.1 Submission of Blog Posts
9.2 Displaying Blog Posts
9.3 Making It Easier to Find Users to Follow
9.4 Pagination of Blog Posts
9.5 Page Navigation
9.6 Pagination in the User Profile Page
Chapter 10: Email Support
Introduction
10.1 Introduction to Flask-Mail
10.2 Flask-Mail Usage
10.3 A Simple Email Framework
10.4 Requesting a Password Reset
10.5 Password Reset Tokens
10.6 Sending a Password Reset Email
10.7 Resetting a User Password
10.8 Asynchronous Emails
Chapter 11: Facelift
Introduction
11.1 CSS Frameworks
11.2 Introducing Bootstrap
11.3 Using Flask-Bootstrap
11.4 Rendering Bootstrap Forms
11.5 Rendering of Blog Posts
11.6 Rendering Pagination Links
11.7 Before and After
Chapter 12: Dates and Times
Introduction
12.1 Timezone Hell
12.2 Timezone Conversions
12.3 Introducing Moment.js and Flask-Moment
12.4 Using Moment.js
Chapter 13: I18n and L10n
Introduction
13.1 Introduction to Flask-Babel
13.2 Marking Texts to Translate in Python Source Code
13.3 Marking Texts to Translate in Templates
13.4 Extracting Text to Translate
13.5 Generating a Language Catalog
13.6 Updating the Translations
13.7 Translating Dates and Times
13.8 Command-Line Enhancements
Chapter 14: Ajax
Introduction
14.1 Server-side vs. Client-side
14.2 Live Translation Workflow
14.3 Language Identification
14.4 Displaying a "Translate" Link
14.5 Using a Third-Party Translation Service
14.6 Ajax From The Server
14.7 Ajax From The Client
Chapter 15: A Better Application Structure
Introduction
15.1 Current Limitations
15.2 Blueprints
15.3 The Application Factory Pattern
15.4 Unit Testing Improvements
15.5 Environment Variables
15.6 Requirements File
Chapter 16: Full-Text Search
Introduction
16.1 Introduction to Full-Text Search Engines
16.2 Installing Elasticsearch
16.3 Elasticsearch Tutorial
16.4 Elasticsearch Configuration
16.5 A Full-Text Search Abstraction
16.6 Integrating Searches with SQLAlchemy
16.7 Search Form
16.8 Search View Function
Chapter 17: Deployment on Linux
Introduction
17.1 Traditional Hosting
17.2 Creating an Ubuntu Server
17.3 Using a SSH Client
17.4 Password-less Logins
17.5 Securing Your Server
17.6 Installing Base Dependencies
17.7 Installing the Application
17.8 Setting Up MySQL
17.9 Setting Up Gunicorn and Supervisor
17.10 Setting Up Nginx
17.11 Deploying Application Updates
17.12 Raspberry Pi Hosting
Chapter 18: Deployment on Heroku
Introduction
18.1 Hosting on Heroku
18.2 Creating a Heroku Account
18.3 Installing the Heroku CLI
18.4 Setting Up Git
18.5 Creating a Heroku Application
18.6 The Ephemeral File System
18.7 Working With a Heroku Postgres Database
18.8 Logging to stdout
18.9 Compiled Translations
18.10 Elasticsearch Hosting
18.11 Updates to Requirements
18.12 The Procfile
18.13 Deploying the Application
18.14 Deploying Application Updates
Chapter 19: Deployment on Docker Containers
Introduction
19.1 Installing Docker
19.2 Building a Container Image
19.3 Starting a Container
19.4 Using Third-Party "Containerized" Services
19.5 The Docker Container Registry
19.6 Deployment of Containerized Applications
Chapter 20: Some JavaScript Magic
Introduction
20.1 Server-side Support
20.2 Introduction to the Bootstrap Popover Component
20.3 Executing a Function on Page Load
20.4 Finding DOM Elements with Selectors
20.5 Popovers and the DOM
20.6 Hover Events
20.7 Ajax Requests
20.8 Popover Creation and Destruction
Chapter 21: User Notifications
Introduction
21.1 Private Messages
21.2 Static Message Notification Badge
21.3 Dynamic Message Notification Badge
21.4 Delivering Notifications to Clients
Chapter 22: Background Jobs
Introduction
22.1 Introduction to Task Queues
22.2 Using RQ
22.3 Database Representation of Tasks
22.4 Integrating RQ with the Flask Application
22.5 Sending Emails from the RQ Task
22.6 Task Helpers
22.7 Implementing the Export Task
22.8 Export Functionality in the Application
22.9 Progress Notifications
22.10 Deployment Considerations
Chapter 23: Application Programming Interfaces (APIs)
Introduction
23.1 REST as a Foundation of API Design
23.2 Implementing an API Blueprint
23.3 Representing Users as JSON Objects
23.4 Representing Collections of Users
23.5 Error Handling
23.6 User Resource Endpoints
23.7 API Authentication
23.8 API Friendly Error Messages
Teach online with
11.6 Rendering Pagination Links
Lesson content locked
If you're already enrolled,
you'll need to login
.
Enroll in Course to Unlock