Skip to main content
CourseFlix

Building data-driven web apps with Flask and SQLAlchemy

9h 38m 43s
English
Paid

Embrace the power of Python to craft clean and powerful web applications with this comprehensive course. Once you've mastered basic programming concepts, we will guide you through the process of building data-driven, modern web applications in Python using the popular Flask web framework. If you're aiming to achieve full-stack web development skills, this course delivers essential knowledge through a concise and practical approach, minimizing confusion from the multitude of involved technologies.

Course Resources and Repository

Access the source code and course materials on GitHub:

github.com/talkpython/data-driven-web-apps-with-flask

Our carefully designed course strikes a balance by being just real enough to provide you with practical insights without overwhelming extras. Throughout the course, we will build a replica of a popular web application, specifically Python's own packaging index at pypi.org.

Key Learning Outcomes

Follow along with the development of our PyPI replica, and you will:

  • Explore different major Python web frameworks
  • Create a Flask-based website from scratch using the CLI and PyCharm
  • Work with dynamic HTML templates
  • Utilize routing to map URLs to view methods
  • Leverage advanced routing to build a custom CMS swiftly
  • Implement Bootstrap to craft visually appealing sites
  • Use SQLAlchemy to map data with Python classes
  • Utilize Alembic for evolving databases in response to model changes
  • Capture user input with HTML forms
  • Incorporate client and server-side validation
  • Tackle the unique challenges of testing web apps, including databases and frameworks
  • Deploy your web application on a fresh Linux machine, either virtual or cloud-based
  • Apply our design patterns to convert to other data models, such as MongoDB

Who Should Enroll?

This course is tailored for developers interested in crafting Python-based web applications using Flask. Additionally, the web development skills you acquire here are valuable across different frameworks.

We assume learners come with a foundational understanding of Python, HTML, and CSS, although the course clarifies advanced concepts in these areas as they arise.

About the Author: Talk Python Training

Talk Python Training thumbnail

Talk Python Training is the paid course platform of Michael Kennedy, the host of the long-running Talk Python To Me podcast — one of the most-listened-to podcasts in the Python ecosystem. The course platform extends Michael's interview-based knowledge of the field into structured video courses taught by Michael and a curated set of guest instructors.

The course catalog covers the full Python landscape: web development with Django, Flask, FastAPI, and the broader async-Python stack; data science and pandas; LLM / RAG application development; testing and CI/CD; deployment patterns; the data-engineering side of Python; and a long list of practical Python patterns aimed at working developers. Few platforms cover the language with this much breadth from inside the Python community itself.

The CourseFlix listing under this source carries over 18 Talk Python Training courses spanning that range. Material is paid; Talk Python Training runs on per-course pricing on the original platform. Courses are aimed at developers using Python as a serious primary language rather than as a scripting tool.

Watch Online 186 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 186 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Introducing the course
All Course Lessons (186)
#Lesson TitleDurationAccess
1
Introducing the course Demo
00:44
2
The incredible power of web
01:36
3
What is fullstack development?
03:17
4
Student expectations and pre-reqs
01:34
5
The technologies we will learn
02:28
6
What can you build with Python?
05:18
7
Course topics
06:05
8
Meet your instructor
00:52
9
What app will we build for this course?
02:06
10
Video player: A quick feature tour
02:05
11
Do you have Python 3? How do you get it?
02:40
12
Our code editor
00:59
13
Git the source code
00:36
14
Following along
01:26
15
What are microframeworks?
02:39
16
Building blocks of Flask
03:32
17
Building block: Views
03:01
18
Building block: Routes and URLs
01:16
19
Building block: Models
01:49
20
Building block: Dynamic HTML Templates
02:29
21
Get the back story
00:59
22
Introduction to creating a Flask website
02:58
23
Demo: CLI starter site
05:56
24
Concepts: CLI starter site
03:00
25
Demo: Creating the starter project PyCharm
03:47
26
Concept: Creating the starter project PyCharm
01:26
27
Project structure
03:10
28
Template chapter introduction
01:24
29
Jinja2 template example
02:31
30
Create the PyPI site
03:42
31
Our first jinja template
08:11
32
Concept: Jinja2 templates
01:43
33
Layout: Motivation
03:20
34
Jinja2 autocomplete in PyCharm
01:13
35
Adding a simple nav element
05:21
36
Creating a common layout page
05:08
37
Better organization for your template files
02:02
38
Concepts: Common layout
02:29
39
Project structure with shared layout
01:35
40
Demo: @response a better render_template
03:38
41
Concept: @response a better render_template
02:03
42
Routing visualized
03:52
43
Demo: Routing, loading the project
01:23
44
Refactoring view methods with Flask blueprints
09:13
45
Concept: Refactoring view methods with Flask blueprints
01:21
46
Adding a constrained route
03:42
47
The account management routes
02:59
48
Concept: Create route from url
01:29
49
How to build a CMS in 8 minutes
07:55
50
Concept: Routing to add a custom CMS
01:18
51
What we'll cover
00:54
52
CSS Front-end framework survey
02:03
53
Introduction to using Bootstrap
04:51
54
Running in a real web server
01:00
55
Intro to grid layout
02:53
56
Responsive browser tools
01:13
57
Grid layout in action
01:35
58
Adding to the grid
03:25
59
Concept: Grid layout
01:44
60
Buttons and forms
01:15
61
Buttons and forms in action
04:48
62
Style the login form
03:32
63
Concept: Buttons and forms
01:31
64
Why Bootstrap themes are awesome
01:43
65
Bootstrap theme tour
05:45
66
Our site design
03:15
67
Home page HTML
05:12
68
The making of the hero
05:23
69
Stats slice
03:20
70
New releases
03:49
71
Adding the navigation
03:50
72
Final footer
03:57
73
Introducing SQLAlchemy
04:07
74
Who uses SQLAlchemy?
01:35
75
Architecture
02:14
76
The database model
03:11
77
Modeling packages
08:31
78
SQLAlchemy model base class
01:52
79
Connecting to our 'database'
06:01
80
Creating tables
06:27
81
Indexes
05:01
82
The rest of the tables
04:25
83
Relationships
07:17
84
Concepts: Modeling
04:15
85
Creating the basic insert script
02:19
86
Connecting to the database (again)
01:36
87
Setting package values
01:34
88
Saving the package to the db
03:37
89
Running the inserts
02:35
90
Adding type hints to the session factory
01:21
91
Inserting real PyPI data
01:39
92
Concept: Unit of work
02:23
93
Querying data: Home page
05:55
94
Querying data: Latest releases
09:04
95
Working with package details
09:19
96
Concept: Querying data
04:03
97
Concept: Ordering data
00:45
98
Concept: Database updates
00:49
99
Concept: Relationships
02:00
100
Concept: Inserting data
00:37
101
Introducing database migrations
03:47
102
Getting started with Alembic
02:32
103
Our first change
09:17
104
More database changes
05:29
105
Concept: Getting started
01:44
106
Concept: Alembic - the manual version
03:10
107
Concept: auto-generating changes
01:51
108
The basics of HTML input
03:14
109
GET-POST-Redirect pattern
02:36
110
Register for the site (getting started)
03:14
111
Registration form
01:43
112
A little design for the register form
04:45
113
Register POST action
02:44
114
Getting the submitted values
05:09
115
Creating the user
06:59
116
Login form
01:09
117
Login code
03:20
118
Creating a user session (cookies)
07:16
119
Navigation items based on user's session
02:54
120
One source of data
04:20
121
The motivation for viewmodels
02:50
122
Viewmodel base class
04:16
123
Using a viewmodel
03:19
124
The register viewmodel
10:24
125
Concept: Viewmodel
01:41
126
Simplified view methods
01:23
127
Viewmodel data exchange
01:45
128
Server-side validation with Viewmodels
01:37
129
Client-side validation with HTML5
04:55
130
Concept: Client-side validation with HTML5
01:26
131
Why write tests (web)
02:10
132
Special challenges of the web
02:33
133
3 types of web unit tests
03:09
134
Organizing your tests
03:00
135
Getting started with tests
03:46
136
Testing the register viewmodel
05:49
137
Avoiding the database call on register
03:26
138
Testing registration when inputs are invalid
02:26
139
Concept: Testing view models
01:34
140
Testing view methods
05:28
141
Concept Testing view methods
03:47
142
Integrated tests
05:40
143
The rest of the tests
02:29
144
Running tests outside of PyCharm
02:10
145
Concept: Testing the full web app
01:02
146
Pareto principle and testing with sitemaps
04:45
147
Deployment overview and topology
03:45
148
02-creating-our-linux-server
05:15
149
The setup script and config files
03:12
150
Configure the server
07:47
151
Make the virtual environment always active
01:44
152
Setting up our code
02:52
153
Running under uWSGI
03:28
154
uWSGI as a service
02:03
155
Running in nginx
03:30
156
Adding SSL with Let's Encrypt
03:58
157
Concept: uWSGI
01:20
158
Concept: nginx
01:19
159
Introduction to the NoSQL version
01:42
160
Not a MongoDB course
00:55
161
How document databases work
01:15
162
Connecting to MongoDB
04:56
163
The user entity with mongoengine
03:41
164
Saving a user
03:25
165
The rest of the entities
01:44
166
Rewriting our queries
06:01
167
Fixing the login
02:27
168
Importing the data from SQL to Mongo
03:21
169
Home page cleanup
04:52
170
Package details cleanup
03:32
171
Concepts: MongoEngine and MongoDB
04:25
172
You've done it!
00:41
173
Creating a new Flask app
01:01
174
Jinja2 templates and dynamic HTML
01:44
175
Layout pages
00:57
176
Routes
01:35
177
Themes
00:45
178
Querying data
01:10
179
Database migrations
00:39
180
GET-POST-Redirect
01:17
181
viewmodels
01:30
182
Testing web apps
01:03
183
Deployment
01:18
184
MongoDB edition
00:55
185
git the source code
00:23
186
Thanks and goodbye
00:23
Unlock unlimited learning

Get instant access to all 185 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Course content

186 lessons · 9h 38m 43s
Show all 186 lessons
  1. 1 Introducing the course 00:44
  2. 2 The incredible power of web 01:36
  3. 3 What is fullstack development? 03:17
  4. 4 Student expectations and pre-reqs 01:34
  5. 5 The technologies we will learn 02:28
  6. 6 What can you build with Python? 05:18
  7. 7 Course topics 06:05
  8. 8 Meet your instructor 00:52
  9. 9 What app will we build for this course? 02:06
  10. 10 Video player: A quick feature tour 02:05
  11. 11 Do you have Python 3? How do you get it? 02:40
  12. 12 Our code editor 00:59
  13. 13 Git the source code 00:36
  14. 14 Following along 01:26
  15. 15 What are microframeworks? 02:39
  16. 16 Building blocks of Flask 03:32
  17. 17 Building block: Views 03:01
  18. 18 Building block: Routes and URLs 01:16
  19. 19 Building block: Models 01:49
  20. 20 Building block: Dynamic HTML Templates 02:29
  21. 21 Get the back story 00:59
  22. 22 Introduction to creating a Flask website 02:58
  23. 23 Demo: CLI starter site 05:56
  24. 24 Concepts: CLI starter site 03:00
  25. 25 Demo: Creating the starter project PyCharm 03:47
  26. 26 Concept: Creating the starter project PyCharm 01:26
  27. 27 Project structure 03:10
  28. 28 Template chapter introduction 01:24
  29. 29 Jinja2 template example 02:31
  30. 30 Create the PyPI site 03:42
  31. 31 Our first jinja template 08:11
  32. 32 Concept: Jinja2 templates 01:43
  33. 33 Layout: Motivation 03:20
  34. 34 Jinja2 autocomplete in PyCharm 01:13
  35. 35 Adding a simple nav element 05:21
  36. 36 Creating a common layout page 05:08
  37. 37 Better organization for your template files 02:02
  38. 38 Concepts: Common layout 02:29
  39. 39 Project structure with shared layout 01:35
  40. 40 Demo: @response a better render_template 03:38
  41. 41 Concept: @response a better render_template 02:03
  42. 42 Routing visualized 03:52
  43. 43 Demo: Routing, loading the project 01:23
  44. 44 Refactoring view methods with Flask blueprints 09:13
  45. 45 Concept: Refactoring view methods with Flask blueprints 01:21
  46. 46 Adding a constrained route 03:42
  47. 47 The account management routes 02:59
  48. 48 Concept: Create route from url 01:29
  49. 49 How to build a CMS in 8 minutes 07:55
  50. 50 Concept: Routing to add a custom CMS 01:18
  51. 51 What we'll cover 00:54
  52. 52 CSS Front-end framework survey 02:03
  53. 53 Introduction to using Bootstrap 04:51
  54. 54 Running in a real web server 01:00
  55. 55 Intro to grid layout 02:53
  56. 56 Responsive browser tools 01:13
  57. 57 Grid layout in action 01:35
  58. 58 Adding to the grid 03:25
  59. 59 Concept: Grid layout 01:44
  60. 60 Buttons and forms 01:15
  61. 61 Buttons and forms in action 04:48
  62. 62 Style the login form 03:32
  63. 63 Concept: Buttons and forms 01:31
  64. 64 Why Bootstrap themes are awesome 01:43
  65. 65 Bootstrap theme tour 05:45
  66. 66 Our site design 03:15
  67. 67 Home page HTML 05:12
  68. 68 The making of the hero 05:23
  69. 69 Stats slice 03:20
  70. 70 New releases 03:49
  71. 71 Adding the navigation 03:50
  72. 72 Final footer 03:57
  73. 73 Introducing SQLAlchemy 04:07
  74. 74 Who uses SQLAlchemy? 01:35
  75. 75 Architecture 02:14
  76. 76 The database model 03:11
  77. 77 Modeling packages 08:31
  78. 78 SQLAlchemy model base class 01:52
  79. 79 Connecting to our 'database' 06:01
  80. 80 Creating tables 06:27
  81. 81 Indexes 05:01
  82. 82 The rest of the tables 04:25
  83. 83 Relationships 07:17
  84. 84 Concepts: Modeling 04:15
  85. 85 Creating the basic insert script 02:19
  86. 86 Connecting to the database (again) 01:36
  87. 87 Setting package values 01:34
  88. 88 Saving the package to the db 03:37
  89. 89 Running the inserts 02:35
  90. 90 Adding type hints to the session factory 01:21
  91. 91 Inserting real PyPI data 01:39
  92. 92 Concept: Unit of work 02:23
  93. 93 Querying data: Home page 05:55
  94. 94 Querying data: Latest releases 09:04
  95. 95 Working with package details 09:19
  96. 96 Concept: Querying data 04:03
  97. 97 Concept: Ordering data 00:45
  98. 98 Concept: Database updates 00:49
  99. 99 Concept: Relationships 02:00
  100. 100 Concept: Inserting data 00:37
  101. 101 Introducing database migrations 03:47
  102. 102 Getting started with Alembic 02:32
  103. 103 Our first change 09:17
  104. 104 More database changes 05:29
  105. 105 Concept: Getting started 01:44
  106. 106 Concept: Alembic - the manual version 03:10
  107. 107 Concept: auto-generating changes 01:51
  108. 108 The basics of HTML input 03:14
  109. 109 GET-POST-Redirect pattern 02:36
  110. 110 Register for the site (getting started) 03:14
  111. 111 Registration form 01:43
  112. 112 A little design for the register form 04:45
  113. 113 Register POST action 02:44
  114. 114 Getting the submitted values 05:09
  115. 115 Creating the user 06:59
  116. 116 Login form 01:09
  117. 117 Login code 03:20
  118. 118 Creating a user session (cookies) 07:16
  119. 119 Navigation items based on user's session 02:54
  120. 120 One source of data 04:20
  121. 121 The motivation for viewmodels 02:50
  122. 122 Viewmodel base class 04:16
  123. 123 Using a viewmodel 03:19
  124. 124 The register viewmodel 10:24
  125. 125 Concept: Viewmodel 01:41
  126. 126 Simplified view methods 01:23
  127. 127 Viewmodel data exchange 01:45
  128. 128 Server-side validation with Viewmodels 01:37
  129. 129 Client-side validation with HTML5 04:55
  130. 130 Concept: Client-side validation with HTML5 01:26
  131. 131 Why write tests (web) 02:10
  132. 132 Special challenges of the web 02:33
  133. 133 3 types of web unit tests 03:09
  134. 134 Organizing your tests 03:00
  135. 135 Getting started with tests 03:46
  136. 136 Testing the register viewmodel 05:49
  137. 137 Avoiding the database call on register 03:26
  138. 138 Testing registration when inputs are invalid 02:26
  139. 139 Concept: Testing view models 01:34
  140. 140 Testing view methods 05:28
  141. 141 Concept Testing view methods 03:47
  142. 142 Integrated tests 05:40
  143. 143 The rest of the tests 02:29
  144. 144 Running tests outside of PyCharm 02:10
  145. 145 Concept: Testing the full web app 01:02
  146. 146 Pareto principle and testing with sitemaps 04:45
  147. 147 Deployment overview and topology 03:45
  148. 148 02-creating-our-linux-server 05:15
  149. 149 The setup script and config files 03:12
  150. 150 Configure the server 07:47
  151. 151 Make the virtual environment always active 01:44
  152. 152 Setting up our code 02:52
  153. 153 Running under uWSGI 03:28
  154. 154 uWSGI as a service 02:03
  155. 155 Running in nginx 03:30
  156. 156 Adding SSL with Let's Encrypt 03:58
  157. 157 Concept: uWSGI 01:20
  158. 158 Concept: nginx 01:19
  159. 159 Introduction to the NoSQL version 01:42
  160. 160 Not a MongoDB course 00:55
  161. 161 How document databases work 01:15
  162. 162 Connecting to MongoDB 04:56
  163. 163 The user entity with mongoengine 03:41
  164. 164 Saving a user 03:25
  165. 165 The rest of the entities 01:44
  166. 166 Rewriting our queries 06:01
  167. 167 Fixing the login 02:27
  168. 168 Importing the data from SQL to Mongo 03:21
  169. 169 Home page cleanup 04:52
  170. 170 Package details cleanup 03:32
  171. 171 Concepts: MongoEngine and MongoDB 04:25
  172. 172 You've done it! 00:41
  173. 173 Creating a new Flask app 01:01
  174. 174 Jinja2 templates and dynamic HTML 01:44
  175. 175 Layout pages 00:57
  176. 176 Routes 01:35
  177. 177 Themes 00:45
  178. 178 Querying data 01:10
  179. 179 Database migrations 00:39
  180. 180 GET-POST-Redirect 01:17
  181. 181 viewmodels 01:30
  182. 182 Testing web apps 01:03
  183. 183 Deployment 01:18
  184. 184 MongoDB edition 00:55
  185. 185 git the source code 00:23
  186. 186 Thanks and goodbye 00:23

Related courses

Frequently asked questions

What is Building data-driven web apps with Flask and SQLAlchemy about?
Embrace the power of Python to craft clean and powerful web applications with this comprehensive course. Once you've mastered basic programming concepts, we will guide you through the process of building data-driven, modern web…
Who teaches Building data-driven web apps with Flask and SQLAlchemy?
Building data-driven web apps with Flask and SQLAlchemy is taught by Talk Python Training. You can find more courses by this instructor on the corresponding source page.
How long is Building data-driven web apps with Flask and SQLAlchemy?
Building data-driven web apps with Flask and SQLAlchemy contains 186 lessons with a total runtime of 9 hours 38 minutes. All lessons are available to watch online at your own pace.
Is Building data-driven web apps with Flask and SQLAlchemy free to watch?
Building data-driven web apps with Flask and SQLAlchemy is part of CourseFlix's premium catalog. A CourseFlix subscription unlocks the full video player; the course description, table of contents, and preview information are available to everyone.
Where can I watch Building data-driven web apps with Flask and SQLAlchemy online?
Building data-driven web apps with Flask and SQLAlchemy is available to watch online on CourseFlix at https://courseflix.net/course/building-data-driven-web-apps-with-flask-and-sqlalchemy. The page hosts every lesson with the integrated video player; no download is required.