The New and Improved Flask Mega-Tutorial
The most complete introduction to web development with Python and Flask
Watch Promo
The Flask Mega-Tutorial is an overarching tutorial for Python beginner and intermediate developers that teaches web development with the Flask framework. The tutorial was born as a series of blog articles, and has been thoroughly revised, updated and expanded as a result of a successful Kickstarter campaign. The concepts that are covered go well beyond Flask, including a wide range of topics Python web developers need to know when writing their own applications.
The goal of the course is to build a nicely featured social blogging web application. Chapter 1 begins with a very simple version of this application that has just a few lines of code. Then, each successive chapter adds a new feature to it. The 23 chapters in this course can be roughly split into two parts: the first 12 chapters are focused on basic web development concepts, while the remaining 11 chapters cover intermediate and advanced techniques. All the code featured in this tutorial is open source, and is available on GitHub. You are welcome to use any of it for your own projects!
This edition of the tutorial includes over 11 hours of video showing how to perform all the steps, plus the written version, which is an ebook of approximately 330 pages. The ebook can be read online, or downloaded in PDF, EPUB and MOBI formats.
Important Note: The content in this tutorial was created in 2018 and revised in 2021, so you should expect minor issues due to changes in Python, Flask and other dependencies used. The blog version of this tutorial can be used as guidance to resolve problems.
Your Instructor
Miguel Grinberg has over 25 years of experience as a software engineer in a variety of areas such as web development, microservices, cloud, computer animation and video broadcasting. He blogs at https://blog.miguelgrinberg.com about a variety of topics including web development, Python, JavaScript, robotics, photography and the occasional movie review. Miguel lives in Drogheda, Ireland.
Course Curriculum
-
StartIntroduction (0:15)
-
StartDatabases in Flask (0:58)
-
StartDatabase Migrations (0:53)
-
StartFlask-SQLAlchemy Configuration (6:15)
-
StartDatabase Models (4:57)
-
StartCreating the Migration Repository (1:41)
-
StartThe First Database Migration (2:10)
-
StartDatabase Upgrade and Downgrade Workflow (1:20)
-
StartDatabase Relationships (7:53)
-
StartPlaying with the Database (7:43)
-
StartShell Context (2:11)
-
StartIntroduction (0:14)
-
StartPassword Hashing (4:46)
-
StartIntroduction to Flask-Login (1:15)
-
StartPreparing the User Model for Flask-Login (1:02)
-
StartUser Loader Function (1:54)
-
StartLogging Users In (8:28)
-
StartLogging Users Out (2:43)
-
StartRequiring Users to Login (5:16)
-
StartShowing the Logged In User in Templates (1:22)
-
StartUser Registration (12:51)
-
StartIntroduction (0:12)
-
StartDatabase Relationships Revisited (2:32)
-
StartRepresenting Followers (0:57)
-
StartDatabase Model Representation (6:24)
-
StartAdding and Removing "follows" (6:06)
-
StartObtaining the Posts from Followed Users (5:16)
-
StartCombining Own and Followed Posts (1:37)
-
StartUnit Testing the User Model (4:16)
-
StartIntegrating Followers with the Application (7:08)
-
StartIntroduction (3:32)
-
StartIntroduction to Flask-Mail (3:07)
-
StartFlask-Mail Usage (2:53)
-
StartA Simple Email Framework (1:09)
-
StartRequesting a Password Reset (2:13)
-
StartPassword Reset Tokens (7:53)
-
StartSending a Password Reset Email (3:18)
-
StartResetting a User Password (4:56)
-
StartAsynchronous Emails (2:16)
-
StartIntroduction (0:12)
-
StartIntroduction to Flask-Babel (5:44)
-
StartMarking Texts to Translate in Python Source Code (3:39)
-
StartMarking Texts to Translate in Templates (2:18)
-
StartExtracting Text to Translate (3:00)
-
StartGenerating a Language Catalog (5:24)
-
StartUpdating the Translations (1:34)
-
StartTranslating Dates and Times (2:32)
-
StartCommand-Line Enhancements (3:25)
-
StartIntroduction (0:26)
-
StartServer-side vs. Client-side (1:57)
-
StartLive Translation Workflow (2:10)
-
StartLanguage Identification (5:50)
-
StartDisplaying a "Translate" Link (1:42)
-
StartUsing a Third-Party Translation Service (10:17)
-
StartAjax From The Server (2:39)
-
StartAjax From The Client (11:20)
-
StartIntroduction (0:12)
-
StartIntroduction to Full-Text Search Engines (1:38)
-
StartInstalling Elasticsearch (2:22)
-
StartElasticsearch Tutorial (6:50)
-
StartElasticsearch Configuration (3:09)
-
StartA Full-Text Search Abstraction (9:31)
-
StartIntegrating Searches with SQLAlchemy (7:53)
-
StartSearch Form (7:01)
-
StartSearch View Function (3:07)
-
StartIntroduction (0:22)
-
StartTraditional Hosting (1:03)
-
StartCreating an Ubuntu Server (1:52)
-
StartUsing a SSH Client (1:44)
-
StartPassword-less Logins (6:07)
-
StartSecuring Your Server (4:25)
-
StartInstalling Base Dependencies (3:31)
-
StartInstalling the Application (4:54)
-
StartSetting Up MySQL (2:48)
-
StartSetting Up Gunicorn and Supervisor (4:25)
-
StartSetting Up Nginx (7:19)
-
StartDeploying Application Updates (1:19)
-
StartRaspberry Pi Hosting (1:16)
-
StartIntroduction (0:12)
-
StartHosting on Heroku (0:32)
-
StartCreating a Heroku Account (0:14)
-
StartInstalling the Heroku CLI (1:37)
-
StartSetting Up Git (0:58)
-
StartCreating a Heroku Application (1:41)
-
StartThe Ephemeral File System (1:11)
-
StartWorking With a Heroku Postgres Database (1:12)
-
StartLogging to stdout (2:35)
-
StartCompiled Translations (0:44)
-
StartElasticsearch Hosting (0:56)
-
StartUpdates to Requirements (0:55)
-
StartThe Procfile (2:26)
-
StartDeploying the Application (2:38)
-
StartDeploying Application Updates (0:25)
-
StartIntroduction (0:25)
-
StartServer-side Support (2:16)
-
StartIntroduction to the Bootstrap Popover Component (2:35)
-
StartExecuting a Function on Page Load (2:00)
-
StartFinding DOM Elements with Selectors (1:51)
-
StartPopovers and the DOM (5:29)
-
StartHover Events (3:48)
-
StartAjax Requests (3:41)
-
StartPopover Creation and Destruction (3:04)
-
StartIntroduction (0:14)
-
StartIntroduction to Task Queues (1:37)
-
StartUsing RQ (8:19)
-
StartDatabase Representation of Tasks (3:05)
-
StartIntegrating RQ with the Flask Application (4:02)
-
StartSending Emails from the RQ Task (2:16)
-
StartTask Helpers (3:29)
-
StartImplementing the Export Task (5:26)
-
StartExport Functionality in the Application (2:30)
-
StartProgress Notifications (7:45)
-
StartDeployment Considerations (6:57)
-
StartIntroduction (0:23)
-
StartREST as a Foundation of API Design (4:34)
-
StartImplementing an API Blueprint (2:18)
-
StartRepresenting Users as JSON Objects (4:19)
-
StartRepresenting Collections of Users (3:58)
-
StartError Handling (4:04)
-
StartUser Resource Endpoints (10:58)
-
StartAPI Authentication (18:15)
-
StartAPI Friendly Error Messages (3:02)