#484: From React to a Django+HTMX based stack Transcript
00:00 Have you heard about HTMX? We've discussed it a time or two on the show.
00:03 We're back with another episode on HTMX, this time with a real-world success story and lessons
00:10 learned. We have Sheena O'Connell on to tell us how she moved from a React Django app to pure
00:16 Django with HTMX. This is Talk Python to Me, episode 484, recorded October 29th, 2024.
00:23 Are you ready for your host, here he is!
00:27 You're listening to Michael Kennedy on Talk Python to Me. Live from Portland, Oregon,
00:32 and this segment was made with Python.
00:34 Welcome to Talk Python to Me, a weekly podcast on Python. This is your host, Michael Kennedy.
00:42 Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython,
00:48 both accounts over at fosstodon.org, and keep up with the show and listen to over nine years of
00:54 episodes at talkpython.fm. If you want to be part of our live episodes, you can find the live streams
00:59 over on YouTube. Subscribe to our YouTube channel over at talkpython.fm/youtube and get notified
01:05 about upcoming shows. This episode is sponsored by Posit Connect from the makers of Shiny. Publish,
01:12 share, and deploy all of your data projects that you're creating using Python. Streamlit,
01:16 Dash, Shiny, Bokeh, FastAPI, Flask, Quarto, Reports, Dashboards, and APIs. Posit Connect supports all of
01:24 them. Try Posit Connect for free by going to talkpython.fm/Posit, P-O-S-I-T.
01:30 And this episode is brought to you by Bluehost. Do you need a website fast? Get Bluehost. Their AI
01:36 builds your WordPress site in minutes, and their built-in tools optimize your growth. Don't wait.
01:42 Visit talkpython.fm/bluehost to get started. Gina, welcome to Talk Python to me.
01:48 Thanks so much. Happy to be here.
01:50 I'm happy to have you here. We've got an awesome topic queued up. One that I just, I don't know if
01:56 I'll ever get tired of coming back to this because I'm just such a fan of simplicity and getting stuff
02:01 done and not like, let's see how many layers of things we can pile on. And by that, I mean,
02:07 HTMX as a success story for going from a whole bunch of front-end stuff, a bunch of different
02:14 multi, multiple apps, you know, JavaScript front-end, Django back-end, talking to each other,
02:19 but kind of being separate as well. Oh, yeah.
02:21 And just switching to HTMX. And you wrote up a really cool essay on this that we're going to
02:25 dive into, so, and share your experience.
02:27 Pretty fantastic experience overall. I was really surprised by HTMX when I came across it the first
02:33 time because there are so many fashionable front-end libraries and frameworks. So when I heard about it,
02:39 I was like, oh, it's another one of those, whatever. And then I went to a DjangoCon, I think it was 2022,
02:46 and I saw a talk from Chris May, who's in the audience, and that's got me excited about it. And
02:52 yeah, that's kind of when my whole story started. What I had been doing before was working with,
03:00 so I had this team, and we were building a thing, and we had a React front-end. So on the front,
03:05 that's a normal thing. Like if you wanted a modern front-end application, you'd use something like
03:11 React or Vue or one of the many competitors. And then on the back end, we had Django. And I think that's
03:17 like a fairly normal, fairly accepted way to do things, or it has been for a long time.
03:23 But I think it's like, I think it's a little faulty. I think that front-end web development has
03:29 been in a little bit of a complexity death spiral for the last little while. And like, sometimes it's
03:35 useful, sometimes it's really helpful. But like for some things, you need certain tools in the front
03:40 end, I think. But yeah, I think it's, things have been going in the complexity for a direction for a
03:45 long time. And HTML solves a lot of problems.
03:48 Right. Well, you think back, you know, think back to the jQuery days. How did you use jQuery? You
03:54 included a CDN, or if you're wild, you might download it and include it in your own static content. And
04:00 then you just started using it, right? And just layers and layers have just been building. And
04:05 JavaScript of 2024 era looks nothing like 10 years ago, 15 years ago, JavaScript.
04:11 Yeah. I would say it's one of the more complicated programming environments compared to something
04:16 like C++, right? Because there's so many steps in there, so many implicit linkings and stuff.
04:21 Yeah, there's a lot of dark magic under the hood. It's very hard to know what's going on. And
04:25 I think like one of the challenges is that a lot of people used to get into web dev as their gateway
04:31 drug to programming. Like they'd start off with web dev and then branch out from there. But now web dev is
04:36 like this magic weird box with so many layers. And I think it's, it's sort of messed a lot of people
04:42 up. It's a challenge to get started in the way that people used to get started. And it's like the barrier
04:47 to entry level programmers used to need to be here. And now it's here. And yeah, there's a lot of key
04:54 things to the ecosystem as a whole. But yeah, like all the build steps, all the magic things that happen
04:59 under the hood. And the fact that you have to like tasks switch between completely different applications
05:04 and completely different like ways of thinking. So for me, I've always loved Django. It's so good.
05:10 So with the thing that I was building, I wanted Django because I needed to build a thing really,
05:16 really fast. And so my efficiency was important. And then it was like, I need a good front end. And
05:21 react was, was a clear choice at the time, but it means like switching, like, like for me to work
05:27 on this thing, I need to keep holding the Django application and the react application in my head
05:32 and how they talk. And it's not just react. It's like Redux and Saga and side effects and asynchronous
05:37 goodies. And, and then on the Django side, it's all of that. And Django is, I think much simpler to get
05:43 your head around than react. Actually, it's a tricky thing. It definitely is a tricky thing. And one thing I
05:49 would just like to put out early before we get too much mail is this is not necessarily a,
05:54 a hate on JavaScript. Oh no, no. There are people in the node space that are super fans of HTMX. And I
06:02 think what is not obvious about the benefits of HTMX, as we get into it, we'll, we'll talk about some of
06:08 these things, but you were just touching on then, like you've got this react front end, it has its own
06:12 state. It also has its own capability. So it's running in the client side. So it can't talk to file systems or the
06:17 database. It can only talk to APIs. On the other hand, you've got the Django app, which probably is
06:22 not talking to APIs, but talks to the database talks to, you know, the server levels things. And you've
06:27 got to, as you're working on this app, think, okay, I'm in this context. That means no database. I'm in
06:32 this context. That means primarily just database. Right. And it's just, you have these two worlds.
06:37 And if you could say, can I just write in one of them? Yes. And the JavaScript people might even
06:41 pick like, I just want to stay in JavaScript, but always node or always at least, you know, pick one
06:47 of the styles of programming and not just constantly switch back and forth between these. You have
06:52 browser capabilities, you have server capabilities, you have browser information. Like just, that is just not
06:56 productive. It's not the best. Right. And so as much as you can avoid that, and as we'll see,
07:01 HTML is super easy about keeping it in one place. Right. So that's, I think that's one of the big
07:07 things that people should, should be honing in on as we talk about this. What do you think?
07:11 If I came across as hating on JavaScript, I think JavaScript did. I use it a lot where it's needed.
07:16 I think it is a fantastic tool in the toolbox that I'm on sides with you, that it's just the
07:21 complexity of switching contexts all the time. It slows you down and it's a lot to keep in your head.
07:26 And so it's like, for me, when I was working on this application and needing to switch contexts all the
07:31 time, it's like, like you can't just make a thing. Like you have to like do the dance to make the
07:37 thing. And it's. Instead of four different chained file watchers to do their things and stuff. Right.
07:43 So it just like adds a little bit of a, like you're slower than, that you would like to be. There's like
07:49 more tedium than there should be. It'd be nice if you could just like build the thing quickly in a
07:53 simple way and it just works and is beautiful. And HTML kind of allows that along with other tools.
08:00 Yeah. So for me, that context switching was like a painful, painful thing. And for the team I was
08:05 working with as well, like I had a bunch of juniors on my team and it was so hard to get them productive
08:09 because it was like, okay, do you want to be productive on the back end? Or do you want to be
08:13 productive on the front end? And then on the front end, like that was complicated because of the,
08:18 again, React, Redux, Redux saga. So, so they were all just like suffering. And then.
08:24 To put real features into place, you've got to do a vertical slice, right? Which hits most,
08:29 if not all, you know, you probably, you probably have to touch the React front end.
08:33 Yeah.
08:33 You probably need some new tiny bits of UI design. So CSS and maybe some
08:38 SAS build step there. And you know, like then you're doing the server side bits and then you're
08:44 doing a database migration and it's just like, it's end to end, right?
08:47 Yeah. And for some people that's not even reasonable to expect them to have all of those
08:52 skills, those end to end skills. And then it's like, you have to make your team complicated. You
08:56 have to have a back end team and a front end team and they need to now integrate with each other. And so
09:01 like the team resembles the team stack.
09:03 Yeah.
09:04 Yeah. That's interesting. Yeah. We have a group for this later, a group for that later. And you know,
09:09 look, if you're a huge company, maybe that actually makes tons of sense. Maybe I'm not,
09:12 I'm not saying it does, but it may, but when you're a small company, it just doesn't. Right.
09:17 Right.
09:17 When you're building something, you do need to think about the team that's going to be building
09:21 it. The skills right now, the skills that they're going to have in the future, the skills that you're
09:25 going to need to pull into the team in the future. And so it's, I don't know if it makes sense to,
09:30 well, in my context, it didn't make sense to, to split up the team. If I had the tools to allow
09:36 everybody to be in the same place from the beginning, that would have been freaking fantastic.
09:40 Yeah, absolutely. That would be awesome. Let's talk a bit about HTML. So we, we said,
09:44 Hey, we've been talking about this by and sort of broad terms, but let's be a little bit specific.
09:49 And maybe you could tell us like, what is this HTML and why is it, why is it not just a different
09:56 flavor of reactor view or something? And then maybe we could talk to you a few examples.
10:00 The way I explain HTML to myself is that like, imagine looking at HTML, HTML is with us. It's,
10:08 it's going to be with us forever, maybe not forever, but for a very long time. What, what if we like
10:13 There've been many, yeah, there've been many attempts to replace it and they were all bad.
10:16 Yeah. Yeah. So it's, it's probably going to stick around for the foreseeable future and it's everywhere.
10:22 And what if we could just augment it slightly so that it could do what we needed it to do in the
10:28 modern web. Like we, like since HTML got invented, like it's quite a simple tool, but now we need to
10:34 do all this extra stuff because people expect all sorts of like interactivity in the user interfaces.
10:40 They expect asynchronous workloads and things like that. And what if HTML could do that? And it can
10:47 do that. And it's not actually that hard to make it do that. You just need to add a few extra attributes.
10:52 And so what HTML is, is a really, really small JavaScript library. And you just include it as a
11:00 script tag in your page and then it's there and it's available and it's installed just like the old,
11:06 the good old days of jQuery. And yeah, you could just go back and throw it in a CD and if you wanted,
11:12 couldn't you? That's right. I hadn't really thought about it. From there, you, you just have these extra
11:15 attributes on your HTML tags that do different things. So for example, like, so HTML says a lot of
11:21 different stuff, but if you were to like 80, 20 years and look at the parts that are the most used,
11:27 then basically the stuff you'll use the most are like tying into events, like click event handlers or
11:33 whatnot. And then when you click on the thing or whatever, it'll send in a request to a backend and
11:40 the backend responds with an HTML fragment. And then you swap that fragment into your page somewhere.
11:50 So if you were to look at the, the HTML documentation, the, the hello world of HTML is a button and the
11:57 button says, has the attributes HX post clicked. So it's saying like, when you click on the button,
12:03 then send a post request to a URL that's like forward slash click. So you can decide where,
12:08 like what HTTP method you're using and where it's going and what event you're tying into. And then
12:16 when the response arrives, then you do something with it. And the response is HTML. It's not a JSON response that you,
12:22 they need to like turn into HTML. It's, it's plain old normal HTML. So it's super simple to write. And then you,
12:30 you take that HTML and you put it somewhere on the page. So maybe you swap the current buttons that you just clicked with,
12:36 with the HTML that was returned, or maybe you take it and you put it like at the end of another element. You can, you can, you can, you can,
12:43 you can, you can, you can, you can, you can, you can pre-pen stuff. You can replace entire elements. You can replace the internals of elements. And that little pattern is actually really, really powerful. And you can tie into all sorts of different events. So there's like interacting with individual elements, like a click or a form submission.
12:59 You can say like on load or like on scroll or all sorts of different things. So, so events. Yeah.
13:05 Absolutely. So one of the motivations that Carl Carson Gross puts there is why should a and form only be able to make HTTP requests? Why should you only be able to click and have click and submit events, trigger them, right? And all these things, you know,
13:21 So it's kind of like just extending some of these niche features. Like you can click a button, but not an image in HTML to, to all the pieces. And then like you said, exchanging fragments of HTML, right? Like just instead of sending JSON back and then having the client side, turn that into HTML, just do it on the server and stick it where it goes. Right. Basically that's it.
13:41 Basically that's it.
13:42 It's, it's dead simple to code as well, which is, which is fantastic. So it's a simple, you're just server side rendering some HTML like we used to a long time ago. So it feels, it feels very familiar to people who got into web dev a long time ago. The code itself is very, very easy to write. Like initially you might like scratch your head. It's unfamiliar, but give yourself a couple of hours and it'll start to feel familiar. It's yeah. It's lovely to work in.
14:07 Yeah. I would also encourage people that want to get started with this and play with this. The examples that they have on the website are pretty comprehensive, right? If you scroll through, I don't know how many there are, maybe 20 or so.
14:18 Yeah. More than that. It's a lot.
14:20 Yeah. There's a lot of them here. And then, so if you go into each one of them, it'll show you basically some interesting things. So if you go to the first one, the click to edit, it says, here's a bit of static HTML, like a label and a div, and then a button that says click to edit.
14:35 And all it has is HX get, and it says edit this thing. Right. And when you go and click it, like there's a little example at the bottom, you click it. That's all fun. But if you open up the bottom, there's like a little history of interactions.
14:49 And like, I don't know what you call it, but like a web history that shows what's transferred. So when you, you click edit, here's what the response was. And it shows the HTML fragment, which in itself is a new HX has HX events. And then when it saves it, it goes back to the static and so on. And I think it's a really pretty easy way to get a sense for what it is. What do you think?
15:11 Yeah, yeah. Yeah, I think so. I think so. Those examples are great. I think like one thing that I like to do is use HTML and a thing called Alpine JS together.
15:21 So for me, HTML is great for when the data needs to be passed back and forth. But like for something like this, I'd probably use something like Alpine just to say like, show and hide, hide the form.
15:32 Yeah, it's also fantastic. So you don't like strictly need it, I suppose, but it does save on like some back and forth. And it does make things a little bit more like in one place, a little bit more like locality of behaviors, a useful thing.
15:47 So now we're looking at Alpine JS hello world. And this is cool because it also it's like HTML in that it just adds a couple of extra attributes to your HTML tags.
15:58 And the 80/20 of this is that you can define variables and those variables are like this, like a state, and they are defined within the scope of the place where you defined it.
16:12 So if you if you have like div x data equals open false and as a JSON object, then it's like within the scope of the stuff, we have this thing called open and its initial value is false.
16:22 And then you can do things like click on a button to to change open to true or to toggle to toggle open.
16:28 So you can have it like show form true or false. And then you can say then you can like say here it says span extra equals open.
16:35 So we only show that under certain circumstances. And you can also have like not open or you can have like it speaks JavaScript.
16:42 So you can do some interesting things in there as well.
16:44 Yeah, this is pretty interesting. This is yeah, this is something I have not really used, but I do hear Alpine and HTML X mentioned together frequently.
16:52 They do have a similar vibe.
16:53 Yeah, yeah, they do. They do. Yeah, I've enjoyed a lot. I tend to just use it for like small, simple things, but those small, simple things add up.
17:00 And so for example, if you have menus that open and close and things like that, you might you might want to use something like this.
17:06 Yeah, or event handling, like if you click this button, change the state to this and then it triggers the binding to open and close sections and so on. Yeah.
17:15 Yeah. Yeah. Okay. Interesting.
17:19 This portion of talk Python to me is brought to you by Posit, the makers of Shiny, formerly RStudio and especially Shiny for Python.
17:27 Let me ask you a question. Are you building awesome things? Of course you are. You're a developer or data scientist.
17:33 That's what we do. And you should check out Posit Connect. Posit Connect is a way for you to publish, share and deploy all the data products that you're building using Python.
17:43 People ask me the same question all the time. Michael, I have some cool data science project or notebook that I built.
17:49 How do I share it with my users, stakeholders, teammates? Do I need to learn FastAPI or Flask or maybe Vue or React.js?
17:57 React.js? Hold on now. Those are cool technologies and I'm sure you'd benefit from them, but maybe stay focused on the data project.
18:04 Let Posit Connect handle that side of things. With Posit Connect, you can rapidly and securely deploy the things you build in Python.
18:11 Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quarto, ports, dashboards and APIs. Posit Connect supports all of them.
18:20 And Posit Connect comes with all the bells and whistles to satisfy IT and other enterprise requirements.
18:26 Make deployment the easiest step in your workflow with Posit Connect.
18:30 For a limited time, you can try Posit Connect for free for three months by going to talkpython.fm/posit.
18:36 That's talkpython.fm/posit. The link is in your podcast player show notes.
18:42 Thank you to the team at Posit for supporting Talk Python.
18:47 One example that I can give from over that stuff that I'm working on is I'm definitely using HTMLX over at Talk Python Training, right, for our courses.
18:54 And I added this little tag cloud.
18:57 It's not quite a cloud, but a bunch of different things you can explore.
18:59 So when you load this page, actually, one of the things that's really challenging is it has the price in your local currency.
19:06 So it figures out where your IP, where you live.
19:08 And that currency, the prices of those things, you know, outside of the US change a lot.
19:13 And it's super, sometimes it can be really slow to figure out what the price of every course is, if there's sales and you're in this country and that applies in this way.
19:20 So all these prices are all calculated with HTMLX.
19:24 So it loads normally without the prices, then probably by the time you get to it, the prices are already there automatically.
19:30 And then as you click around, you get this is all like as you click these little tags up here, you can even click on the HTMLX tag and see you have three HTMLX courses, right, with last Django and one that's just kind of uses it.
19:42 But all of this stuff, this is no JavaScript on this page, at least not doing any of that is all just HTMLX, right?
19:48 Yeah, that's great.
19:50 Beautifully good. It's so good.
19:51 I've certainly enjoyed working with it.
19:53 But let's talk a bit about your right of like, let's talk about, you know, spend the rest of time on your story, how you started using HTMLX.
20:00 I mean, you've given us some of the sense, but let's talk about the app that you were building, right?
20:06 You had this team of fairly junior developers.
20:09 What's the story?
20:10 At the time I was working for a nonprofit training provider in South Africa.
20:15 And we used to have everybody on premises in this place called JP's town, which is really a dodgy place.
20:22 And it was great.
20:23 It was, it was a lot of fun.
20:24 But then COVID happened.
20:25 And so we had to figure out how to support everybody remotely.
20:28 And so it built an LMS.
20:31 So initially we like looked around that LMS means learner management system.
20:35 We had a whole lot of learners.
20:36 We had, I think there were about 150 at the time.
20:39 And we needed to figure out like how to support them from home.
20:43 We couldn't just be like, come back next year because the like, partially we couldn't let them down.
20:48 Partially the funding model wouldn't work and all sorts of things.
20:50 So we need, it was an insane time.
20:52 It's kind of normalized in our history because it's, we've moved past it, but we got to remember that's an, that was a disturbing time.
20:58 So many people have horror stories from, from then I was like, this was hard.
21:03 It was like super, super stressful, but in the end we ended up with this cool thing.
21:07 So like a lot of LMSs exist.
21:10 You can get one off the shelf and they're a lot like very clever textbooks that track learners over time.
21:16 But for us, we're training, we are training software developers.
21:19 And so we wanted something more than a textbook.
21:22 We wanted to train professionals.
21:23 And so we ended up building this thing from the learners perspective.
21:27 It was a Kanban board and then they could move cards around on the board to do different things.
21:32 They could like start a project and then we'd create a repo for them and make, add them as a collaborator and protect the main branch and all of that good stuff.
21:40 And then we could get them to review each other and could track all that and display it in the front end.
21:44 Right.
21:45 Try to teach them get in GitHub and PRs and all that.
21:48 Yeah.
21:49 Yeah.
21:50 So the time they got to work, like they're always very nervous getting into their first job.
21:54 And then they'd say like, this is familiar.
21:56 Like we know how this, and that was really, really cool.
21:58 I'm teaching people stuff here actually.
22:00 That's weird.
22:01 Yeah.
22:02 It was great.
22:03 Exactly.
22:04 That's cool.
22:05 Yeah.
22:06 So I built this thing out and managed to keep training the people and it worked.
22:09 then it was like, okay, this thing is pretty rough around the edges because we built it in self-defense.
22:14 And we're like, I hope this works.
22:18 So we needed to, to build more on it.
22:21 And we were hiring a lot of junior developers because we were training like very, very beginner stuff.
22:28 So if you want to teach a person what a return statement is or what a loop is or anything like that, then you don't need a senior developer or like a senior lecturer.
22:36 You need somebody who understands what a loop is and what a, what a return statement is.
22:40 So we had like all these juniors running around, like helping out and they needed to build stuff with their own growth as well.
22:48 And their own, like if they don't build stuff and they, and then built and it's sad.
22:52 So, so yeah, they were trying to get them productive on the stack, but it was very, very difficult.
22:58 So for me, I'd been working on react applications and I've been working on Django.
23:02 And so for me, it was fine.
23:03 I could just like, I could keep the whole thing in my head, but yeah, it was just, it was just really tough for them.
23:09 I think there is a little bit of an art to making a junior developer productive, but like, I just was not figuring it out.
23:16 So I tried this for a while and then one day went to a Django con us and I saw Chris May's talk that spoke about HTMX.
23:25 And I was just like, maybe this is worth a try.
23:27 I was like, okay, I'm just going to proof of concept it and see if I can build the weirdest parts of our application in HTMX.
23:34 If you're asking, will it work?
23:36 You're like, this is the most crazy interactive bit.
23:39 And if it can do this, the other stuff is easy.
23:41 Like switching from logged in to log out or whatever.
23:45 I was like, yeah, okay, that's nothing.
23:46 Right.
23:46 Most of our functionality was around this Kanban board.
23:49 So I was like, all right, let me just make some cards and make some columns and see if I can shift stuff around.
23:54 And it all worked out really well.
23:57 And it wasn't, it wasn't super hard.
23:59 Like I think one of the, one of the challenges with HTMX is that it's very easy to build like spaghetti templates.
24:06 Cause you have like the main template and all these partials and you need to, and then all these URLs that are pointing to the partial.
24:12 So it's, so it is possible to get yourself in a bit of a tangle there.
24:15 So you need to arrange things nicely.
24:17 But yeah, the process was so smooth that I was like, let me try this.
24:21 So our application was this Django app on the back, exposing a bunch of APIs with Django REST framework.
24:27 And so the idea was to just, instead of like, we'd, we'd leave the react app as is, and we'd keep on working.
24:34 Meanwhile, we'd, we just build out some like perfectly normal Django views to do the HTMX stuff.
24:39 And then we could move everybody over to the new, the new application.
24:43 So the new front end was part of the original Django app.
24:46 So we didn't, we didn't rebuild absolutely everything.
24:49 We just rebuilt that part.
24:50 And generally speaking, if somebody suggests rebuilding a thing, I worry.
24:56 Like usually it's a bad idea.
24:58 Usually it's like, yeah, a fool or something.
25:02 Yes.
25:03 I've had to stop myself many times.
25:05 Do you know that David, Dylan BD it is?
25:09 Yeah.
25:10 I'll put a link in here.
25:11 He's got some, some amazing parodies and one's it's a six and a half minute parody of American Pie.
25:17 We're going to do the big rewrite.
25:18 And it's, it's glorious.
25:19 So I'll link it, but you should be afraid, right?
25:22 This is something that like, we're going to rewrite it.
25:25 And basically the song is here's the eight version, the eight different languages.
25:28 This thing's previously been written in, you know, it's with some things working times, even if it's not perfect.
25:34 You just.
25:35 Yeah.
25:36 And it was also like rewriting it in order to optimize for this team that was mostly juniors.
25:40 And so I was like, is this like, is this me being crazy?
25:43 Like there was a lot of, yeah, I was, I was very unsure.
25:47 So I tried everything out and, and it worked and it was fun.
25:50 And it was like, like straightforward to write for this like small thing.
25:54 And then I was like, let me see how the team works on this.
25:57 So I gave them a bunch of little tasks to do.
26:00 I was like, implement this, try that.
26:02 And everybody was productive.
26:04 How did they receive it?
26:05 When you, when you introduced this idea to them after they'd been living in react and redux and all these things.
26:12 They were happy with it.
26:13 I think at first a little bit skeptical, but then once I started going, like I did get feedback from them.
26:19 I make a point of getting feedback from them.
26:21 And they were like, this HTMX thing is way better.
26:23 So that's great.
26:26 Like, wait, what's the trick?
26:27 Why does this work?
26:28 So they went with it, but, and then they succeeded and they were happy and productive, which is great.
26:34 And like, even people who needed like way too much of my support, like people who I had to like really sit with and pair with, like just to do like anything.
26:41 They were suddenly able to do stuff that was meaningful.
26:44 So I think for me, that's one of the things that's so exciting about HTMX.
26:48 It's like, I've been working and training for so long and I've been like fighting the fight of like getting junior developers job ready for so long that like I'm, I'm aware of many problems in the tech education ecosystem and the junior hiring ecosystem.
27:04 And like the fact that entry level positions are like too hard for people, like it's a problem.
27:11 And now we have tools that make web developments approachable again.
27:15 So like I'm singing this HTMX song because I think it's going to change the industry in, in some pretty big ways.
27:21 I think it's already making waves, but I'd like them to happen faster and bigger.
27:26 Yeah, I think it will as well.
27:28 And, you know, I think the current web frameworks are really good and work really well with it.
27:33 But I wonder if I wouldn't be surprised to see kind of like FastAPI came along and just said Pydantic is the essence of this thing.
27:41 And Pydantic changed a lot of data exchange, a lot of data validation.
27:44 And I wonder if some framework comes along and just says HTMX is just ground up part of this thing.
27:50 All right.
27:51 That'd be interesting to see what that looks like.
27:52 That would be interesting.
27:53 I think there are definitely useful patterns and how to, how to do different things.
27:57 And people are building tools around it or tools that complements it in useful ways.
28:02 So we spoke about Alpine JS.
28:03 There's another thing called template partials from Carlton Gibson.
28:08 And he, and that's really, really great.
28:11 Something like this is super needed to make the code go from like, all right, we can do this too.
28:16 Oh, that's nice.
28:17 Yeah.
28:18 Yeah.
28:19 Yeah.
28:20 This really unspaghetti fires it, which is fantastic.
28:21 Like this is one of my favorites at the moment.
28:24 I have one that I created for a Jinja card Jinja, Jinja, Jinja partials, and also a chameleon one.
28:30 So since I'm, I wasn't using for that, that course example, this is actually chameleon.
28:35 So I use the chameleon partials, but something like this is required and you know, Carlton does great work, right?
28:41 Yeah.
28:42 Known for it.
28:43 So you're using this as part of, as part of your, your site.
28:45 So not that original site.
28:46 I only heard about this later on, but now I use it on everything.
28:50 Yeah.
28:51 On all of my HTMX things.
28:53 I use this.
28:54 Right.
28:55 Tell the Django people, what does this do?
28:57 Like why, why do you need Django template partial?
28:59 Django template partials instead of just Django templates.
29:02 So it's just about organizing your code in a way that's a bit cleaner.
29:05 So if you think about how you would render templates from your different views, if you had like a main page and then that page had a bunch of HTMX things happening that, that made calls to the back end to different views.
29:18 And those different views.
29:19 And those different views use different templates.
29:21 Then even though that all those templates are associated with the same page, it kind of ends up being a bit of a mess.
29:27 You've got like a lot of different, like partial templates.
29:30 So you need a cool naming convention for that.
29:33 So you need to see the pages as a template.
29:34 But you need to switch between files all the time to see what things are associated with each other.
29:43 Let's say you've got like five pages and each of them have like five different partials associated with them.
29:48 Suddenly it's a lot of files and you need to organize things somehow.
29:53 So what Django template partials does is it allows you to like, like, say you've got like a main page file to do list, right?
30:01 Right. You could define a partial template for a to do item within that same file and it won't get rendered until you say render this thing.
30:10 So you can like when you render your template for the first time, you can just say, OK, loop over the to do items and use this partial in place and render the things.
30:19 And that's great.
30:20 But then the other thing that you can do is that you can like in a view, you can choose to render a template, but you can choose to render a partial within that template as well.
30:31 And so let's say you've got like a little form that says add a new to do list item.
30:37 Then you'd submit that form and then the view would look for the partial within the page that you care about and it'll render that.
30:47 And so it just ends up being that like everything is tidy and together and it makes sense because like the to do list items are only used in this page and those items are only used in that page.
30:57 One of the big challenges that you'll quickly run into with this style, this HTML partial exchange style is when you show the page originally, you want just the server rendered version, which includes, let's say, your to do items.
31:11 So you need the HTML for the to do items in the main page.
31:14 But then when you make changes to it, you need a little fragment of that same HTML to put a new to do item in there or to edit one or something.
31:23 And if you're not careful, well, then you have multiple copies of those laying around and somebody updates the design for one and then it doesn't update the partial one that you wrote, which is a copy.
31:33 It's it's not pretty.
31:35 So finding a way for reuse like this Django templates partials, it's pretty required, I think, if you're going to stay sane.
31:42 It's like functions are required to write code.
31:44 You know, it's it's pretty much like that. Right.
31:46 I think so. Like you can get away with just using like lots of files and you could keep things dry with lots of files, but it gets like it's very spaghetti unless you're you put a lot of effort into organizing it and then keeping it organized because people make PRs do like all weird things.
32:03 So, yeah, it's it's not good to have to like monitor that everything's organized.
32:09 It would be better if it was just there done by default, like the next to the behavior is correct.
32:14 Yeah. Yeah.
32:15 So to grab grab a file, a library for that.
32:19 This portion of talk Python to me is brought to you by Bluehost.
32:22 Got ideas, but no idea how to build a website.
32:25 Get Bluehost with their AI design tool.
32:28 You can quickly generate a high quality, fast loading WordPress site instantly.
32:33 Once you've nailed the look, just hit enter and your site goes live.
32:36 It's really that simple.
32:37 And it doesn't matter whether you're a hobbyist, entrepreneur or just starting your side hustle.
32:42 Bluehost has you covered with built in marketing and e-commerce tools to help you grow and scale your website for the long haul.
32:49 Since you're listening to my show, you probably know Python, but sometimes it's better to focus on what you're creating rather than a custom built website and add another month till you launch your idea.
32:59 When you upgrade to Bluehost cloud, you get a hundred percent of time and 24 seven support to ensure your site stays online through heavy traffic.
33:08 Bluehost really makes building your dream website easier than ever.
33:11 So what's stopping you?
33:12 You've already got the vision.
33:14 Make it real.
33:15 Visit talkpython.fm/bluehost right now and get started today.
33:20 And thank you to Bluehost for supporting the show.
33:22 Let's talk about the before and after stack.
33:26 So before you talked about react, but tell us all the pieces involved and then what does it look like today?
33:33 So Redux was for just state management.
33:35 And then I used Redux saga for mostly for data fetching stuff so that I could handle like loading spinners and I could see like different, like the status of different requests over time and that kind of thing.
33:47 Then I used material UI because my front end make pretty skills aren't the strongest.
33:54 So I wanted a component library that would just work and that was the chosen one.
33:59 Then on the back end, it was Django.
34:02 Django REST framework is fairly well known.
34:05 Then I used a thing called Django Guardian because I needed object level permissions on the different model instances.
34:11 So for example, so we had this Kanban board and there were cards on this board that the people could move around and different people would have different permission to different cards.
34:20 So we had things like one learner would be working on a card and then they'd ask for a review and then another learner should be able to review that.
34:28 But we wouldn't want to let just any learner look at their code because then it would cause all sorts of problems.
34:35 So it's like, okay, this person has finished this project so we can add them as a reviewer on this card.
34:40 And so we needed to be like pretty particular about like which of our users could see different things.
34:46 It wasn't super straight, obvious, straightforward and that this person can see this.
34:50 It was like this person can for these reasons.
34:52 Django Guardian is really, really cool.
34:55 And then Postgres.
34:56 That's a cool library.
34:57 You know, maybe people could find a nice use for that one.
35:00 Like that's, that's the one that's new to me.
35:01 Yeah.
35:02 That's really nice.
35:03 And you can even do things like when you query a database and you say, fetch me all the cards, you can do something like,
35:09 fetch me all the cards that Bob can see.
35:12 And so long as it's configured well, then, then it can do that sort of thing, which is very, very helpful.
35:18 Wow.
35:19 That's really cool.
35:20 So you don't have to go get all the cards and then, yeah.
35:23 Yeah.
35:24 Who have all these different permissions and then like construct some query that comes up with it.
35:28 Yeah.
35:29 Very nice.
35:30 I love it.
35:31 And that plugs into DRF as well.
35:32 So like your, your serializer or your view set.
35:36 So I haven't worked in it in a while, but the query that's a lot of data.
35:38 But the query that gets, gets used when you access like a list API endpoint, you could just apply that automatically as well.
35:46 So if you, so you don't need to, yeah, you don't need to build it in that, in that case either.
35:50 So it plugs into all of the things.
35:52 It's a little bit weird at first to get used to.
35:54 And then, and then it's just fantastic.
35:55 And now I'm guessing much of the front end stuff is probably not there.
36:00 The old application still exists, but it's not, but it's like the HTML based version would just be a drop in replacement.
36:07 So I go to this URL instead kind of thing.
36:10 Yeah.
36:11 Now that it's done.
36:12 Now that it's done.
36:13 You said you used to work there, but you don't work there anymore.
36:15 Is that right?
36:15 Oh yeah.
36:16 Not anymore.
36:17 As of a few months ago.
36:18 I guess that's recent enough to say sort of, how is it going now?
36:21 Right?
36:22 How are, how's it being used?
36:23 How are people, you know, is it still going strong as the technology?
36:26 I hope that they're still building on it.
36:28 There was some, some weird things happening at the organization before I left.
36:32 So yeah, I expect, I hope that everything is still going smoothly, but I haven't been plugged in for a while.
36:38 Let's give a, maybe a quick shout out to this video, this other Django con talk.
36:45 Gosh, why is, I need to sign into my YouTube premium on this browser, but this real world SaaS product example from this guy in France, David Gilead.
36:55 Yeah.
36:56 That, that one you said was a pretty good example.
36:58 If you need like a walkthrough case.
37:00 Yeah.
37:01 So that one, I didn't see it live.
37:02 I saw a video of it after the fact, but it is like the ultimate HTMLX demo.
37:07 It shows, this guy really makes it dance.
37:10 It's, it's quite an amazing thing to see.
37:12 So highly recommend that.
37:14 Yeah.
37:14 This guy, David goes through and says, you know, here's our complex SaaS product and let me walk you through all the features.
37:21 I feel like this would be a pretty good one.
37:23 Everyone, your article as well.
37:25 And then this video, if, if you want to say, make a case to your team, like, Hey everyone, can we consider doing this?
37:32 And yeah, I'm sure right off the bat, you'll get some folks.
37:34 So, well, no, we have to use react.
37:36 We have to use this.
37:37 It's interactive.
37:37 This, you interact with that part and it changes that part.
37:39 How are we going to possibly pull that off?
37:41 It's like, yeah, no, that's, that's totally possible.
37:43 Yeah.
37:44 I think the main arguments people have against it are like scale, but that argument doesn't make super, a lot of sense to me.
37:49 I think it might be complexity scale that they're concerned about, but I think things like template partials solve a lot of that problem.
37:55 And then there's, can it do the things?
37:58 And this solves that problem.
38:00 And then is it really, is it really so much better for the team?
38:04 Is the other question?
38:05 Is it just another fashion?
38:06 Is it just another fad?
38:07 And that's something that's sometimes hard to get across.
38:10 I think that my article will do a good job of explaining why it's a good idea.
38:16 Cause I had to explain this to non-technical stakeholders.
38:19 I was like, okay, I I'm making this crazy decision and this is why.
38:23 And so I think I've got the argument down.
38:25 Go, go read that article if you need to convince someone.
38:28 But I think the other thing to mention is the, the full stack that I moved to in the end.
38:33 Yeah.
38:34 So HTMX we spoke about Django.
38:35 We spoke about an Alpine.
38:36 We spoke about now, if you are running a.
38:39 A react front end or whatever you would test the front end in a react way.
38:44 Like you would use tools that are appropriate for that.
38:46 So, and so you need to think about different ways to, to test things.
38:49 Would that be like Selenium or something?
38:52 Or what are we talking?
38:53 So I like play, right?
38:54 Quite a lot.
38:55 So you could do it with, but that would be a, like, it would include some pain.
38:59 Playwright is very, very lovely to, to work with.
39:02 So it's like Selenium only with all sorts of useful test goodies built in.
39:08 So like you can get it to take videos of your failed tests and it's got useful flags for like running your tests on different browsers.
39:17 And you can like keep a trace of things.
39:20 It's got interesting debugging stuff built in and you can just run it with pytest.
39:24 And so yeah, playwright is a big part of it as well.
39:27 Yeah, playwright is really nice.
39:28 You know, one thing that just occurred to me around the testing, if you've got a rich JavaScript front end sort of thing, you have to use something like playwright or Selenium where it does a full browser request render of the page to interact with it.
39:41 Right.
39:42 And you can also do that with HTMLX.
39:44 But a lot of these web frameworks, you can just in your, your web test code, you can say, create like a, a testing instance of my server.
39:53 Right.
39:54 And then make it do this request and then see what the response came back without nearly the same overhead.
39:59 And because this stuff all happens on the server, I guess you could just write a unit test, like a web test against a fragment response.
40:07 Right.
40:08 Yeah, you can.
40:09 So you can, you can write little unit tests that check different things like that.
40:13 But since a lot of the interactivity is defined within the HTML tags, your unit tests won't, they won't be able to cover like if the unit fix this and that happens.
40:22 And so that's where, that's where something like playwright will come in.
40:25 Yeah.
40:26 You'll still need that to, but maybe less playwright is needed than otherwise is what I was thinking.
40:30 Yeah, definitely.
40:31 I think one of the, the anti patterns I've seen is too much playwright where they're just like, want to use playwright for everything.
40:36 And then your tests are ridiculously slow.
40:38 And it's like, you could have just, you don't even need to test the view.
40:42 There was this function that you wanted to test.
40:44 Exactly.
40:45 You're not Shakespeare.
40:46 You don't need that much playwright.
40:47 Come on.
40:48 Yeah.
40:49 Yeah.
40:50 Playwright is a cool thing.
40:51 I definitely recommend it.
40:52 Yeah.
40:53 Yeah.
40:54 And it plugs into Django really smoothly as well.
40:55 So you don't actually, so playwright, it spins up a browser and points it at a running instance of an application in order to like test the things.
41:01 But with Django and pytest, you can use a fixture to spin up like test version of your, of your application.
41:09 It's kind of like run servers running there in your tests anyway.
41:12 So it integrates very, very smoothly.
41:14 Yeah.
41:15 It makes it very convenient.
41:16 Yeah, absolutely.
41:17 You know, one of the things you wrote a lot about, and you, you mentioned this, but you kind of flew past it a little bit was you said, am I crazy for optimizing for junior developers?
41:28 Right.
41:29 On the other hand, optimizing for simplicity, even if you're, you're an expert, right?
41:36 You don't, just cause you can do all the steps and all the complexity doesn't mean you should constantly be doing those steps.
41:42 Right.
41:43 I think there's a case for optimizing for simplicity here.
41:45 What do you think?
41:46 I completely agree.
41:47 I mean, if you, if you can just like take the, the cognitive load of developing your app and then make it like simple.
41:53 So you can focus on actually solving problems instead of wiring, I suppose.
41:58 And life gets a lot, gets a lot easier.
42:00 So yeah, simplicity rocks.
42:02 It's, it's fast to develop, but things like, like HTMLX make your code way, way smaller than, than it would otherwise be.
42:09 So it's not just simple.
42:10 It's not just that it's less convoluted.
42:12 There's also less of it.
42:13 And so there's less to test.
42:15 There's, there's less stuff that can, can cause bugs.
42:17 And most of the like front end interactivity is handled by another library that's really well tested.
42:24 And you're just doing these like tiny little things that are easy to reason about.
42:28 And so it's just, it's robust and clean.
42:32 So yeah, I do think it's worth optimizing for simplicity.
42:35 I mean, it made, it made everybody more productive, the juniors and me as well.
42:40 So top notch.
42:42 I'm constantly in pursuit of, of trying to keep things simple.
42:47 You know, if you go over to the HTMX site, I don't know if you've, you've looked at this section, but they've got a, you know, Kirsten has this essay section, which, you know, it's not quite a blog, but it's kind of a blog.
42:58 You know, it does, it's not, not in order.
43:01 It's in sort of category, whatever.
43:02 And these are all nice.
43:03 One thing that's nice is he has a, on the other hand, here's a couple of examples why people didn't pick it.
43:09 Right.
43:10 But he's got a whole section on complexity.
43:11 Very, very bad.
43:12 Yeah.
43:13 But if you keep going, there's a bunch of memes.
43:16 The memes are so good, aren't they?
43:18 They are fantastic.
43:19 And one of these super definitely applies is, you know, there's one that says HTML plus a backend for like the, you know, it's got this bell curve for the beginners.
43:29 Like, Oh, this is what I want that as you get a little bit better.
43:32 You're like, Oh, I need all this, all this complexity and all these layers.
43:36 And then, you know, sort of the, the Jedi Knight at the end is yeah.
43:39 HTML in the backend.
43:40 I have going, going through this path and like, you don't waste any.
43:44 These two ends.
43:45 Yeah.
43:46 I don't necessarily want to characterize beginners.
43:48 It looked like this, this character in this meme, but you know, I think the meme still speaks, speaks to this somewhat.
43:54 Right.
43:55 Yeah.
43:56 Yeah.
43:57 Definitely.
43:58 Definitely.
43:59 Yeah.
44:00 I think it's about like when I, when I teach people to code, when I teach people like the very basics of code and like something I see with very junior developers is that they try to show off and be like, look how fancy I can make my code.
44:10 I can do all of these complicated things.
44:12 And then you get them to think more like Jedi's and say, like, don't waste any moves.
44:16 Like, like how you wouldn't be flailing about like, this is kind of like flailing.
44:22 And HTML, HTML, HTML does that for you.
44:25 It just lets you like move directly towards your goal instead of having to like move around it.
44:31 Yeah.
44:32 It's pretty glorious.
44:33 So I know that you do a lot of teaching.
44:35 Maybe, you said you work for this local company that was, you did the come on board out for and so on.
44:42 Now, what are you up to?
44:43 I'm teaching just differently.
44:44 It was really cool working there.
44:45 I was there for a long time, like five years in total, which is really long.
44:49 And it was super successful.
44:51 So like since 2020, basically everybody who passed our courses ended up getting good jobs, like very, very close to a hundred percent of the people who passed.
45:01 And the people who didn't pass was like actually kind of small, like 7%.
45:04 And then there's lots of reasons for that.
45:07 But yeah, I learned a ton from being there.
45:10 That was in person, but pre COVID, right?
45:12 Yeah.
45:13 So post COVID, we actually got way, way better because we had better monitoring of individuals and we could do things like track people's cards on their board, moving around.
45:22 And then from that, you can say like, Oh, this piece of content is dodgy.
45:25 Like it would give us as educators, a lot of feedback about what we were doing.
45:29 Cause if a person was stuck and you're like, I explained this thing.
45:33 Great.
45:34 And then they're still stuck.
45:35 You're like, I didn't explain this thing.
45:36 Great.
45:37 Like the way that the teaching mechanism was built was like really good for the students.
45:41 But like, if, if we as educators didn't do a good job on something, we'd know about it and we'd have to fix it.
45:47 And I think that's honed the craft quite a lot.
45:50 So I learned a bunch there.
45:52 Now what I'm doing is I want to spread those skills in different ways.
45:56 So there's a whole lot to what I'm doing.
45:58 One thing I want to do is help educators themselves.
46:02 So I've got this thing called the guild of educators, cause I always wanted to guilt.
46:05 And, it's got a whole lot of people in there who are like, it's a free community.
46:11 Come and join.
46:12 It's a bunch of education nerds who, who talk about education with each other.
46:16 It's a support structure because I think educators need support structures and it's a place to share, share learnings and share resources and opportunities and things like that.
46:27 So it's still very new, but that's one part of it.
46:30 I want to offer teacher training and things like that, but I also just like,
46:34 Just like, we have junior developers.
46:36 You have people got to start somewhere with teaching and teaching online.
46:39 It's different.
46:40 All that.
46:40 It's hard because they aren't really good resources for tech educators.
46:44 There's like, if you dig into the literature on how learning works and how teaching works, it's like, it's all either very academic.
46:53 And so it's a little bit hard to pass and it's not like, it's just not packaged well for the people who need it or it's packaged in the wrong way.
47:01 So I came across a code school recently who I was like, how do you handle your teacher training?
47:06 And they're like, we outsource it to these guys.
47:07 And they showed me this other organization that does teacher training.
47:11 And it's like, I dug through their courses and one of their selling point points was like our teacher training courses are so versatile that they can be used for florists and personal trainers.
47:21 So I was like, yeah, maybe not appropriate for, for what we're up to here, but that's what people are relying on.
47:29 And that's like the best that the industry has to offer.
47:31 So I think there's a big hole in the education space and I want to want to work to fill that.
47:38 Yeah. So that's part of what I'm doing.
47:40 And the other part is offering technical training.
47:42 And this is partially because you've got to like practice the craft partially because I want to create opportunities for educators to get good partially because I like really like teaching the stuff.
47:55 So there's all different reasons why I'm teaching.
47:59 So right now I'm building out a bunch of small workshops that cover different skills and are fairly standalone.
48:05 And those are Lego blocks that will combine into something much bigger in the future.
48:10 But for now, the first workshop that I have on offer is all about Django and HTMLX.
48:16 So it's pretty exciting.
48:18 So it talks about the stack that we just spoke about.
48:21 We didn't mention Tailwind, but Tailwind is great as well.
48:23 It means that I can make front ends that look reasonable.
48:26 That's right.
48:27 You said you had used material UI previously to make it goodish.
48:31 And Tailwind is what used in the new version.
48:33 Yeah, I'm really enjoying Tailwind.
48:35 Yeah.
48:36 So the idea with this little workshop, I ran it as part of DjangoCon US recently.
48:41 It was super cool.
48:42 I got, I don't know, there were way too many people there, which was great.
48:46 But also it was a lot of problems resolved.
48:50 It was like, whoa, all of you.
48:52 That was super cool and went really well.
48:54 The basic idea is that I want to show how to build a crowd application using the stack of tools in a way that sets people up to be able to build their own stuff.
49:04 And part of the workshop is, in fact, taking these tools and building your own thing.
49:10 So for people who are kind of early on their career, in their career, they can get some, like the starts of decent portfolio projects out of it.
49:18 People built all sorts of interesting things.
49:20 The one person built their own personal learner management system for like their own learning, which was really lovely.
49:26 Somebody built a music store.
49:28 Somebody else built a, what was it, like a chore manager for their family so that they don't fight so much.
49:36 It was great.
49:37 Oh, that's interesting.
49:38 Yeah.
49:38 Yeah.
49:39 And all with Django, HTMLX and Alpine JS and the others.
49:42 And the other thing that's cool about this is it's a CRUD application.
49:46 I'm teaching people the bits and pieces that build a CRUD app.
49:50 And like most of the internet is CRUD applications because it's for the audience.
49:55 Like if anybody hasn't heard of CRUD, it's create, read, update, delete.
49:58 Like that's most of what you need to do on the internet.
50:00 And so if you get the patterns down for like a simple CRUD app, then you can do some pretty hardcore things with it.
50:07 So yeah, this is, so it's covering that.
50:09 The workshop is small.
50:11 So it's like, I'm, I'm keeping things very, very small intention intentionally because I believe in the power of teachers.
50:18 And I want to make sure that everybody gets attention and then gets the support that they need.
50:22 And also because of the people who tend to come to these kinds of things have different backgrounds.
50:27 So some people need help here.
50:28 Some people need help there.
50:29 And so you need to keep like a good ratio of teachers to students.
50:33 So yeah, expert led, high support, small group, all of that good stuff.
50:38 Quite exciting.
50:39 That's very cool.
50:40 I'll link to this workshop in the show notes.
50:41 People want to check it out.
50:42 And it's out of time, but it's remote.
50:46 So people can attend from wherever, right?
50:48 You don't have to be near you.
50:49 Yeah.
50:50 So you don't need to be in South Africa.
50:51 In fact, I made it in U.S. Eastern time because strangely enough, most of the people who read my blog are in the U.S.
50:59 So it's U.S. and South Africa and it shifts and changes around.
51:05 But part of the reason I'm marketing it to the U.S. is because I want to be able to fund training Africans.
51:12 And like there just isn't as much money on the side of the world.
51:17 So, yeah, I want to be able to make doing good in the tech education space into something that's financially sustainable.
51:24 So that's why the U.S. and that is why it's priced in dollars.
51:29 Yeah.
51:30 So you guys can have a discount code.
51:32 Talk Python.
51:33 Talk underscore Python.
51:34 I think that was the one I said.
51:35 Let me just share.
51:36 Yeah, I'll put it in show notes.
51:37 People can find it there.
51:38 Awesome.
51:39 So you'll get 10% off.
51:41 And then I also want to give like another 10% to something.
51:45 So Foxly wanted me to give 10% from their discount code to the DSF.
51:52 So that's another code that's out there.
51:54 So that's fantastic.
51:55 I've definitely benefited a lot from the DSF.
51:57 So that's really, really cool.
51:59 So since this is your podcast, should the further 10% go to the DSF or the PSF or the DjangoCon Africa event?
52:08 I vote DjangoCon Africa.
52:09 Fantastic.
52:10 I was hoping that you'd say that.
52:12 Yeah, I love DjangoCon Africa.
52:13 It's so freaking cool.
52:15 Speaking of a conference and talks and stuff, Kim out in the audience says, in a few weeks, a really good talk Sina gave at South Africa PyCon a few weeks ago should be online.
52:26 Power to the people who teach people to code.
52:28 So that's cool, right?
52:29 Yeah, that's cool, right?
52:30 Yeah, that's the longest title I've had for a talk ever.
52:34 Thanks, Kim.
52:35 Yeah, so I did that talk at PyCon South Africa and I also did it, I did a longer version of it at DjangoCon US as a keynote.
52:42 So I was super, super happy that I got that opportunity.
52:45 It's so cool.
52:46 But yeah, it just talks about kind of how I think about teaching and how I, that's how I think about teaching and the mechanisms that we set up.
52:55 So, so like, how does mastery based learning work and how do you actually get, how do you engineer a education system so that it sets people up for success and not like either frustration or boredom?
53:08 Because there's a lot of, a lot of things that are weird about the traditional systems.
53:12 Yeah, so it talks about that, but then it also shares a bunch of lessons for individual educators on the ground.
53:19 So that thing that I was talking about earlier about how we as educators in the system were getting like a ton of feedback about our own, the quality of our work that gave us space to, to figure out a lot of like hard hitting things.
53:33 So it's, it's kind of the 80, 20 of what teachers or would be teachers should, should focus on.
53:39 And I think it's powerful because a lot of like everybody teaches.
53:42 I mean, you teach people, teach new team members.
53:45 Like there's a lot of volunteer teachers as well, which is great.
53:49 I mean, there's stuff like, I think we, I think doing this kind of these presentations, this, this kind of teaching is a super cheat code for leveling up your own skills.
53:57 Yeah, definitely.
53:58 There's this thing called protege effect, which is a well studied thing.
54:02 So when people say teaching is a great way to learn, it's, they're not just being squishy.
54:07 Like it's legit.
54:08 It's really, really legit.
54:10 And there's, there are a lot of mechanisms behind it.
54:14 It's like one of the simple ones is that teaching is spaced repetition and recall.
54:19 And that helps you remember your stuff.
54:21 Another one is like, people will ask you weird questions that you wouldn't expect.
54:26 And so you look at your own knowledge from a different direction and you build better mental frameworks or more robust mental frameworks.
54:33 Like some people are good at building mental frameworks and some people aren't as good.
54:38 And a good way to like get a person to build good mental frameworks is to ask them weird, like left side questions about the stuff they know and get them to look at things from different angles.
54:48 And then you get that from, from the people you're teaching.
54:50 It's yeah, it's really, it's a beautiful thing.
54:52 Yeah, it really is.
54:53 It definitely rounds out your knowledge and makes you think deeply about some of these ideas that you just maybe glossed over.
54:59 Yeah.
55:00 Yeah.
55:01 This is probably a good place to leave it.
55:02 Let's, I want to give out one more resource real quick for people is just awesome.
55:06 HTMLX over on GitHub.
55:07 I don't know if you poked around this, but it's got many, many examples of tools and libraries for HTMLX and Python, but also in a ton of other languages.
55:17 So that's super cool.
55:18 Apparently there's a flashtmxtailwind one and one for sockets or maybe HTMLX over web sockets.
55:25 I don't know.
55:26 These are all look pretty cool.
55:27 So people can check them out.
55:29 But yeah, and I definitely want to recommend people check out your essay and yeah, they can take these ideas and run with them.
55:36 Yeah.
55:37 Cool.
55:38 Well, Gina, thanks for being on the show.
55:40 It's been great to talk to you.
55:41 Yeah, it's been great to talk to you too.
55:42 This was a lot of fun.
55:43 It was.
55:44 Bye.
55:45 Cheers.
55:46 Thank you for another episode of talk Python to me.
55:47 Thank you to our sponsors.
55:49 Be sure to check out what they're offering.
55:51 It really helps support the show.
55:53 This episode is sponsored by Posit Connect from the makers of Shiny.
55:57 Publish, share and deploy all of your data projects that you're creating using Python.
56:02 Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quarto, Reports, Dashboards and APIs.
56:09 Posit Connect supports all of them.
56:11 Try Posit Connect for free by going to talkpython.fm/posit.
56:16 P-O-S-I-T.
56:17 And this episode is brought to you by Bluehost.
56:20 Do you need a website fast?
56:21 Get Bluehost.
56:22 Their AI builds your WordPress site in minutes and their built-in tools optimize your growth.
56:28 Don't wait.
56:29 Visit talkpython.fm/bluehost to get started.
56:32 Want to level up your Python?
56:34 We have one of the largest catalogs of Python video courses over at Talk Python.
56:38 Our content ranges from true beginners to deeply advanced topics like memory and async.
56:43 And best of all, there's not a subscription in sight.
56:45 Check it out for yourself at training.talkpython.fm.
56:48 Be sure to subscribe to the show, open your favorite podcast app and search for Python.
56:53 We should be right at the top.
56:55 You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct
57:01 RSS feed at /rss on talkpython.fm.
57:04 We're live streaming most of our recordings these days.
57:07 If you want to be part of the show and have your comments featured on the air, be sure to
57:11 subscribe to our YouTube channel at talkpython.fm/youtube.
57:14 This is your host, Michael Kennedy.
57:17 Thanks so much for listening.
57:18 I really appreciate it.
57:19 Now get out there and write some Python code.
57:21 We'll see you next time.
57:22 Bye.
57:22 Bye.
57:22 Bye.
57:22 Bye.
57:23 Bye.
57:24 Bye.
57:25 Bye.
57:26 Bye.
57:27 Bye.
57:28 Bye.
57:29 Bye.
57:30 Bye.
57:31 Bye.
57:32 Bye.
57:33 Bye.
57:34 Bye.
57:35 Bye.
57:36 Bye.
57:37 Bye.
57:38 Bye.
57:39 you you Thank you.
57:42 Thank you.