Skip to main content

HTMX + Flask: Modern Python Web Apps, Hold the JavaScript

3h 3m 5s
English
Paid

Course description

htmx is one of the hottest properties  in web development today, and for good reason. This framework, along with the libraries and techniques introduced in this course, will have you writing the best Python web apps you've ever written: clean, fast, and interactive without all that frontend overhead.

Read more about the course

If you are a Python web developer that has wanted to build more dynamic, interactive apps, but just don't want to (or can't) write a significant portion of your app in a rich frontend JavaScript framework, you'll absolutely love htmx. This library lets you write Python code you love and still add that clientside interactive aspect. 

What's this course about and how is it different?

htmx is a very compelling technology. It's one of the first legitimate libraries that delivers on the promise of dynamic, interactive web applications without complex JavaScript. htmx allows us to write server-side code in any language (Python in our case) and, through a few simple HTML attributes, bring our pages to life.

This is the only course (that we're aware of) that shows you the full lifecycle of building Python and Flask-based applications centered around htmx. Unlike basic tutorials where you'll find only just quick coverage of a simple feature, we take a full-fledged web app and extend it by adding three real-world features all building upon htmx.

Moreover, we show you the right way to use htmx with Flask and Python. The resulting code is incredibly clean and would impress almost any professional web developer.

What will we build

In the course, we will add a bunch of htmx-powered features to an existing application. This app, called Video Collector, is a beautiful Flask web app that allows us to save, explore, search, and play videos we've collected from YouTube.

What topics are covered

In this course, you will:

  • See how htmx differs from common JavaScript front-end frameworks such as Vue and React.
  • Understand the server-side exchange enabled by htmx attributes (e.g. ).
  • Add click to edit to an existing data-driven Flask application.
  • Learn about the  package to refactor our jinja2 templates (with or without htmx).
  • Add deep linking to our dynamic web application, allowing us to share links into interactive segments.
  • Add active search to an existing data-driven Flask application.
  • Implement browser history for htmx actions (allowing back and forth navigation).
  • Add infinite scroll to our app.
  • Distinguish between full page requests and partial htmx requests within a single view method in Flask.
  • And lots more

Watch Online

This is a demo lesson (10:00 remaining)

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

View Pricing

Watch Online HTMX + Flask: Modern Python Web Apps, Hold the JavaScript

0:00
/
#1: Introduction to the course

All Course Lessons (66)

#Lesson TitleDurationAccess
1
Introduction to the course Demo
02:29
2
What is htmx?
05:04
3
The HOWL stack
01:36
4
The big ideas covered in this course
03:04
5
Student prerequisites
01:22
6
Vue, React, and htmx: A quick comparison
02:52
7
Git the source code
00:55
8
Meet your instructor: Michael Kennedy
01:10
9
A tour of htmx examples
01:09
10
Example: Infinite scroll
02:41
11
Example: Active search
03:29
12
Example: Lazy loading
02:37
13
Example: Bulk update
03:18
14
Introducing our web app: Video Collector
01:27
15
Setting up and running the Flask app
03:38
16
Key elements of code organization
05:50
17
Concept: Pydantic models
02:04
18
Concept: View models
02:18
19
Concept: Code organization
01:32
20
Our first feature: Click to edit
00:50
21
Introduction to building the non-htmx form
00:57
22
Adding the HTML for the add video form
06:35
23
'Add video' view methods
07:10
24
Creating the new video in the database
03:36
25
Installing htmx
02:27
26
A clean, enable add button, without the form
04:56
27
Server returns the form on-demand
03:42
28
Changing our mind, adding a cancel option
05:59
29
Concept: Showing the edit UI
02:05
30
Concept: Creating or canceling the video creation
01:51
31
Concept: Processing the form submission on the server
01:37
32
What do you mean by partials?
01:49
33
The jinja-partials package
02:06
34
Partials: A more realistic example
01:50
35
Installing jinja-partials
03:49
36
Removing duplication of add video HTML
03:54
37
Concept: Using partials
01:25
38
Introducing active search
00:48
39
Where we're headed with active search
02:01
40
Create the search page skeleton
04:06
41
Search text is better as an optional URL element
01:29
42
Performing the server-side search
04:15
43
HTML input controls for search
02:29
44
Searching as they type with htmx
07:10
45
Rendering the videos found in search
04:29
46
Search history in the address bar
02:21
47
Deep linking to search results
04:01
48
Concept: Triggering the search with htmx
01:14
49
Concept: Is a request htmx originated?
01:24
50
Concept: Supporting deep linking
02:02
51
Introducing infinite scroll
00:53
52
Popular sites using infinite scroll
01:53
53
Reorganizing the feed HTML for infinite scrol
04:18
54
Returning a limited set of videos
03:23
55
The htmx scroll trigger
05:23
56
Implementing more videos on the server
03:54
57
Concept: Triggering another page as you scroll
02:24
58
HOWL for the finish line
01:59
59
Examples first, docs second
01:04
60
Core elements of the starter Flask app
03:14
61
Click to edit functionality
01:54
62
Jinja-partials package
02:11
63
Active search with htmx
02:16
64
Partial or full response?
01:59
65
Infinite scroll with htmx
02:19
66
Thank you and goodbye
00:59

Unlock unlimited learning

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

Learn more about subscription

Comments

0 comments

Want to join the conversation?

Sign in to comment

Similar courses

Python Mega Course: Learn Python in 60 Days, Build 20 Apps

Python Mega Course: Learn Python in 60 Days, Build 20 Apps

Sources: udemy
In this intensive 60-day course, you will go from a beginner with no programming experience to an experienced Python developer capable of creating real...
51 hours 19 minutes 24 seconds
PyTorch for Deep Learning with Python Bootcamp

PyTorch for Deep Learning with Python Bootcamp

Sources: udemy
Welcome to the best online course for learning about Deep Learning with Python and PyTorch! PyTorch is an open source deep learning platform that provides a sea
17 hours 2 minutes 14 seconds
Python for Data Science and Machine Learning Bootcamp

Python for Data Science and Machine Learning Bootcamp

Sources: udemy
Are you ready to start your path to becoming a Data Scientist! This comprehensive course will be your guide to learning how to use the power of Python to analy
24 hours 49 minutes 42 seconds
Python for Financial Analysis and Algorithmic Trading

Python for Financial Analysis and Algorithmic Trading

Sources: udemy
Welcome to Python for Financial Analysis and Algorithmic Trading! Are you interested in how people use Python to conduct rigorous financial analysis and pursue algorithmic tradi...
16 hours 54 minutes 20 seconds
Django 2.1 & Python | The Ultimate Web Development Bootcamp

Django 2.1 & Python | The Ultimate Web Development Bootcamp

Sources: udemy
Have you ever wanted to create a Web application but didn't know where to start? Have you previously tried to learn Django but got fed up with incomplete YouTub
9 hours 52 minutes 1 second