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