HTMX + Django: Modern Python Web Apps, Hold the JavaScript Transcripts
Chapter: Surveying the non-JS-enabled Django app
Lecture: Views for feed and player pages

Login or purchase this course to watch this video and the rest of the course contents.
0:00 The feed page is just a long list of the entire site's contents. The view for this is pretty small.
0:07 It simply queries all the video objects in the system and then renders the feed.html template.
0:14 On this page, or the category listing page, you can click a video to play it.
0:20 Clicking a video takes you to a new page where there's an embedded player. Let's take a look at the view for that.
0:27 of the magic here is inside the HTML getting the correct content to embed a YouTube video.
0:34 Thankfully I had the Flask course to copy the code from and barely had to think about it.
0:39 The view for this page takes an argument which is the ID of the video (no, this is the Django
0:44 ID, not the YouTube ID) and once inside, the video is looked up by ID and then playvideo.html
0:52 is rendered, including all of the YouTube embedding magic.

Talk Python's Mastodon Michael Kennedy's Mastodon