Latest / Talk Python To Me / #233: The Masonite Python Web Framework
Transcript
- 0:00Folks, it's not like the old days where there were just a couple of web frameworks for building applications with Python.
- 0:06These days, there are so many web frameworks to choose from.
- 0:09One of those is the Masonite web framework created by Joseph Mancusio.
- 0:13Joseph is here today to tell us all about Masonite, what makes it special, its core value proposition for web developers, and much more.
- 0:21This is Talk Python To Me, episode 233, recorded September 11th, 2019.
- 0:26Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
- 0:46This is your host, Michael Kennedy. Follow me on Twitter where I'm @mkennedy.
- 0:50Keep up with the show and listen to past episodes at talkpython.fm.
- 0:54And follow the show on Twitter via at Talk Python.
- 0:56Joe, welcome to Talk Python To Me.
- 0:59Thank you. Thanks for having me.
- 0:59Yeah, it's great to have you here.
- 1:00I'm really excited to talk about Masonite and sort of do a quick survey and dive into these modern web frameworks.
- 1:07That's going to be a lot of fun.
- 1:08I think a thousand flowers are blooming these days on the Python web framework world.
- 1:13We've had some stalwart web frameworks, primarily Flask and Django, but Pyramid and before then some others like TurboGears and whatnot.
- 1:23But those all have been around for a really long time and slowly growing or, you know, really slowly maturing.
- 1:29And I feel just like every month there's a new interesting framework.
- 1:33Yeah, yeah. I think that's exactly right.
- 1:35And when I started Masonite, I thought I was doing really, really good.
- 1:39And then I guess it's because I got into the ecosystem.
- 1:42And then all of a sudden I saw like a whole bunch of other frameworks start like blossoming from that.
- 1:45And it's probably because I just wasn't, you know, in it, in the ecosystem more.
- 1:50So I just saw it more.
- 1:51But yeah, there's, it seems like every, every couple of months there's something new coming up.
- 1:54Yeah.
- 1:55It's really positive, I think, but also creates some confusion.
- 1:58We'll talk about that in a bit.
- 1:59Before we get to it, though, let's start with your story.
- 2:01How'd you get into programming and into Python?
- 2:03I always never know which story to tell, like the long story or the short story.
- 2:06But the medium story, I guess, would be that in high school, in ninth grade, I got kicked out of school for a bunch of stuff, like fighting and stuff like that.
- 2:13I was a bad kid.
- 2:14And I had, I was homeschooled for like eight months after that until the next school year.
- 2:20And I was very, very bored.
- 2:23And I didn't really know what to do.
- 2:24And at the time, when I was 14, I was actually into Pokemon too.
- 2:29So I was like, you know what, I'm gonna, like, I'm gonna just play this Pokemon game.
- 2:34And then I got into, and I wanted to like build websites too, because I had a lot of time on my hands.
- 2:38So then I got this website, you know, I started learning like C and then like C++, and I didn't really like it.
- 2:44And then I was like, you know what, I'm gonna start trying to develop websites, maybe.
- 2:49And then I got into PHP, because I found really good documentation.
- 2:54I mean, good YouTube tutorials about PHP.
- 2:58Yeah, and it seems like PHP is like a real quick and easy way into web development.
- 3:03Like a lot of folks go that route, and they kind of, I don't know, graduate to like more formal languages.
- 3:08Python.
- 3:09Yeah.
- 3:09Intermediate level, I guess there.
- 3:11Formal languages.
- 3:12Yeah, sure.
- 3:12Yeah, so I got into PHP, and I watched, you know, the new Boston.
- 3:17I don't know if you've ever seen so many tutorials.
- 3:19Yeah, right.
- 3:20They did a ton of tutorials and stuff.
- 3:21I haven't seen a lot of stuff from them lately.
- 3:23But yeah, they were on all over YouTube for a while, weren't they?
- 3:26He hasn't made a video in like four years.
- 3:27He sort of just dove off to 50,000.
- 3:28But at the time, he was huge.
- 3:30He only had like maybe 40,000, 50,000 subscribers, I think, at the time.
- 3:33And now he's probably at like three or four million.
- 3:35But yeah, I went from there.
- 3:37And then I took sort of this Pokemon thing.
- 3:40And then I used that as my base of a project to build like this website.
- 3:45And then I built, you know, this website.
- 3:47And I had people on Tumblr, I think it was at the time, like start using it.
- 3:52And I thought it was like amazing that you could build something and have people use it.
- 3:56It was like, it was crazy.
- 3:58So I got into PHP.
- 3:59And then from there, I really just took off PHP.
- 4:02Like from like ninth grade to when I graduated high school, you know, 18 years old, I just coded nonstop.
- 4:09I didn't do any homework.
- 4:10I didn't do anything else besides like go to school, come home, and then just start coding.
- 4:15Oh, that's pretty cool.
- 4:16Like it was just your deep passion, huh?
- 4:18Yeah, it just clicked.
- 4:20And I had like this entrepreneurial spirit.
- 4:21And I realized that I can create these websites and sort of make money from them.
- 4:24I can monetize them.
- 4:26I can put ads on them.
- 4:26Did you have friends who were working, like making like $4 an hour minimum wage?
- 4:32And you're like, you know what I'm doing?
- 4:34Yes, I cut them checks.
- 4:35I cut them checks for like $1.25.
- 4:37And I gave it to them in class.
- 4:38Yeah.
- 4:39How'd you know that?
- 4:40Did you, I feel like.
- 4:41No, no, no.
- 4:42I just mean like they had other jobs, like minimum wage jobs.
- 4:45Oh, yeah, yeah, yeah, yeah.
- 4:46And you had like these businesses making real money.
- 4:47Yeah, yeah.
- 4:48I didn't know they were actually working for you directly.
- 4:50But I imagine that you probably in high school had, like I had friends.
- 4:53And even for a while, I worked at like a pizza place.
- 4:56I think I made like $3.25 an hour, right?
- 4:58It was the minimum I could be paid, you know, to go there.
- 5:03And I mean, eventually I went and did some other really wild stuff that is like super funny and
- 5:08outrageous and not probably, it'll be too much of a diversion to cover now.
- 5:11But it's just really funny to probably contrast like you and like high school building these
- 5:18sites, you know, running interesting things and folks going, well, you know, I'm bagging
- 5:23groceries.
- 5:24Now there's anything wrong with that, but it's quite the contrast.
- 5:26Yeah.
- 5:26That's so true.
- 5:27Even my stepbrother now, he does like marketing or something for like, you know, a big like
- 5:30a corporate guy.
- 5:31And he's like, dude, he's like, I wish when you were in the other room, just coding nonstop.
- 5:36He's like, I wish I like, I did it with you.
- 5:38And like, we learned coding together.
- 5:40He goes now, because now you're, you know, you're off doing this job, doing this great big
- 5:43project that you're, you know, your job.
- 5:45And he's like, I'm sort of sitting here like at a cubicle, you know, like just banging
- 5:49paperwork.
- 5:50You really got into it.
- 5:51It sounds like you just really independently went after PHP and Belize sites and that's,
- 5:56that's super cool.
- 5:57So where'd Python come from?
- 5:59When I was 18, I joined the army and I came back and I was still sort of doing programming
- 6:03within the army because it was, you know, it's a passion of mine.
- 6:05It's a hobby.
- 6:06And then when I got out, I wanted to build a POS ordering system that you see like a, like
- 6:12a kiosk almost like a pizza place.
- 6:13So I wanted to build that.
- 6:15So I wanted to learn something new and do it.
- 6:18So I picked up Python just because it was just something new.
- 6:22It was cool.
- 6:22They seemed to be rising at the time with like the whole data science thing and machine learning.
- 6:26So I thought it was cool to sort of pick it up.
- 6:28And then from there I built, I needed to pick a framework and the obvious one at the time
- 6:33seemed to be Django.
- 6:34So I picked up Python for about a month.
- 6:37I learned on like Code Academy.
- 6:38I did like all the basics and then I picked up a framework and then I started building this
- 6:43thing out.
- 6:43It took me about probably eight months or so to build this thing.
- 6:47And then I actually said, all right, you know, I'm going to start trying to sell this
- 6:50thing.
- 6:50In hindsight, it was actually crap.
- 6:52But at the time I thought it was super cool and I wanted to create a company.
- 6:56And one of my all time goals in life is to have a 100 person software development company.
- 7:02Yeah, that's a good goal.
- 7:03I put that in the same ballpark as like...
- 7:05It's nice.
- 7:05It's concrete.
- 7:06Yeah.
- 7:06Yeah.
- 7:07It was like Gary Vaynerchuk's like want to buy the jets sort of thing.
- 7:09So I sort of put it there.
- 7:11Like it probably never happened.
- 7:12Even if you look at like Basecamp, like even they have like a couple dozen employees,
- 7:15I think.
- 7:16And they're like a huge company.
- 7:17So like a hundred person software development company is gigantic.
- 7:19But anyway, I digress.
- 7:21So I built this thing and I even went like door to door to like businesses to try to sell
- 7:25this thing.
- 7:26What was that experience like?
- 7:27Were they receptive?
- 7:28Were they just like, what are you doing here?
- 7:30Like you're from the internet.
- 7:32Why are you in my place, my pizza place or whatever?
- 7:34That's exactly what it was.
- 7:35But actually my whole philosophy is that I'm really not afraid to fail.
- 7:39And even if I fail, I learned something from it.
- 7:41And it was super nerve wracking to like walk in, just cold walk into a business.
- 7:46But I figured like even if I fail, like I'll probably learn something from this guy.
- 7:49And what I actually learned, which was interesting is that when I went in and I asked them if they,
- 7:54if you know, is your manager there?
- 7:55I tried to like, I had like a whole pitch like lined out.
- 7:59And they basically said that, oh no, sorry, we've already tried some and it just, it just
- 8:05doesn't fit us.
- 8:06And I thought that was interesting because I was walking into companies that didn't have
- 8:10it, you know, online, but it makes sense that they've probably been around for five,
- 8:1410 years.
- 8:15And if they don't have one, they had to have tried one already.
- 8:18So I use that failure to sort of repitch into, oh, I know you've tried something before,
- 8:25but maybe you should try this instead.
- 8:27I see.
- 8:28It didn't work before.
- 8:29And here's why it's going to work this time.
- 8:30Right.
- 8:31And something like that.
- 8:31But nobody really went for it.
- 8:33And I'm not really a sales guy.
- 8:34I'm very introverted sometimes.
- 8:36I call myself an ambivert.
- 8:39So I'm like, I'm sort of introverted, but I'm extroverted in comfortable environments.
- 8:44Right.
- 8:44If that makes sense.
- 8:44I think that describes a lot of tech people, honestly.
- 8:46Yeah.
- 8:47Yeah.
- 8:47That's probably true.
- 8:48I think this is the start with most people in general.
- 8:49I mean, very few people I think that I've, I've experienced are really introverted.
- 8:54Like once you get familiar with them and they get comfortable with you,
- 8:57they're just like off the wall.
- 8:58Yeah, for sure.
- 8:59This is a really cool way to get into Python.
- 9:01And where did you go from there?
- 9:03So from there, I learned a, I wanted to learn a new technology.
- 9:07Each year I try to make it a theme.
- 9:10That year I wanted to learn frameworks.
- 9:14So I learned like Django and Python.
- 9:16And then I wanted to, I already came from PHP.
- 9:19So I wanted to learn Laravel because I never learned Laravel all the time.
- 9:22So then I created a new site.
- 9:25You know, us, we just have a bunch of side projects that we try to create businesses out
- 9:29of.
- 9:29I created a new side project, which was basically like a textbook rental service.
- 9:33Okay.
- 9:34And I built like a whole business model out of it and how I was going to do it.
- 9:38And then I built the site in Laravel and I used like Google API and all that stuff to
- 9:42try to build this thing out.
- 9:43And I actually really liked Laravel.
- 9:45And then from there, I worked with Laravel more and more.
- 9:48And then finally I got a job locally working with Laravel at the company I work with now.
- 9:53And that's what I do right now.
- 9:55What are you doing day to day?
- 9:56What kind of work?
- 9:56Sounds like more web development.
- 9:58I continue web development right now.
- 10:00Day to day, I work for a wholesale military supply company.
- 10:05It's actually a pretty big company.
- 10:07It's like 150 person company.
- 10:08The web team is probably about like six strong.
- 10:13And we run this basically this multimillion dollar website that does all the wholesale
- 10:17processing and all that.
- 10:19I also am in charge of a four person software development team that we're working on a large
- 10:25scale ERP project to basically run this whole company.
- 10:28Yeah, cool.
- 10:29So I'm taking a lot of those concepts and trying to come home, apply them to Masonite.
- 10:33Yeah.
- 10:34Excellent.
- 10:34All right.
- 10:35Yeah.
- 10:35So let's dig into the Python web frameworks.
- 10:37So speaking of Masonite, if you go look at the usage stats, we've got
- 10:4240% Django, 40% Flask, plus or minus a couple in there.
- 10:47A little bit down from there, we've got like Pyramid.
- 10:50I think it's like 6% was the last usage I saw there.
- 10:53You know, that rounds out a significant portion of what is Python and web frameworks.
- 10:59But like we talked at the opening, it used to be, well, Flask, Django, which are you?
- 11:05It's kind of was the greeting or whatever amongst the Python web developers, right?
- 11:10The last two or three years, there have been so many different frameworks.
- 11:14We have Jepronto, Sanic, Vibora, Starlet, FastAPI, Hug, Falcon.
- 11:21It's not even a super clear connection.
- 11:23API Star, for example.
- 11:25So there's Starlette and there's FastAPI.
- 11:29FastAPI?
- 11:30Which one?
- 11:30I think there's a handful of websites that actually use Starlette underneath.
- 11:36I think Responder from Kenneth Wright, for example, is one of those.
- 11:40So there's just, there's like this layering on of what people's different ideas of the Python
- 11:45web world should look like.
- 11:47And how would you summarize that?
- 11:50You know, is that looking at trying to make type hints do interesting things?
- 11:54Is that async?
- 11:55What are the trends that you're seeing in all of those or, you know, kind of in general there?
- 11:59So this is mildly controversial.
- 12:01And I actually argue a lot with like the people inside the community.
- 12:04Well, not argue, but, you know, debate a lot with people inside the community of the correct
- 12:08answer is that the trend is moving towards asynchronous frameworks itself.
- 12:14Like the actual framework code is built around some kind of ASBee server or asynchronous server.
- 12:20That's the trend.
- 12:21I'm not entirely sure I agree with the trend because I feel like it forces a lot of people
- 12:27that are new to all of this to sort of see the trend and sort of prematurely optimize their
- 12:34application.
- 12:34So if their application is like a blog framework, for example, they're like, yeah, this blog framework,
- 12:40I mean, sorry, this blog application can handle 15,000 requests per second.
- 12:44But like, does it need to?
- 12:46Does it really need to do that?
- 12:47Like, I mean, that is really cool.
- 12:49And especially if you try to like load balance across two of these applications, like you can
- 12:53handle like thousands and thousands of requests per second.
- 12:55But I feel like it's more of a premature optimization.
- 12:58Like if you want to use and then when they when they use these frameworks, like a lot of times
- 13:03they have to start writing their code with the idea of it being also asynchronous as well.
- 13:09Like, you know, thread safe, I believe in this and all that stuff.
- 13:12And they can't just take any any ORM off the shelf.
- 13:15They have to use like an asynchronous compatible ORM.
- 13:19It basically narrows down a lot of your your decision making.
- 13:23And I'm not entirely sure if you need to create an API or something, some kind of small microservice,
- 13:29just hit API endpoints, get information from a database.
- 13:32That's 100% the way to go.
- 13:34You need if you're creating a bunch of microservices, maybe for one monolithic application,
- 13:38then that's 100% the way to go.
- 13:40But that's not the way I like to create my applications.
- 13:43Right.
- 13:43Yeah.
- 13:44So most people just want to create, you know, like a service like a like a SAS or something.
- 13:48It's an interesting point that you bring up.
- 13:50I would certainly say that there's a trend to see what the cool hot frameworks are doing
- 13:56or what the amazing web companies are doing and try to emulate those way too early.
- 14:03Right.
- 14:03You know, you talked about these websites that you were creating.
- 14:05Like when you're, let's say you're creating your, if you're creating your, your textbook rental
- 14:09company, you know, you're playing it like, well, we're going to have all the campuses around
- 14:14America in September.
- 14:16They're all going back to school and getting their books.
- 14:18It's going to be crazy.
- 14:19And there's going to be all these orders.
- 14:19And it's just, you know, and the reality is probably one campus.
- 14:25If you were lucky joins in and it starts, you know, like it starts real slow.
- 14:29Right.
- 14:29And you've got all the, all the time in the world to see the analytics to, you know, you
- 14:34scale your web server potentially, if you even have to like a standard web app, it can
- 14:40take millions, millions of data-driven requests per month on like a $10 server before you have
- 14:47to start worrying about all that stuff.
- 14:48It's definitely true that you can just not worry about it for a good long while.
- 14:53I mean, if you build your app poorly and it's super slow, then you're going to want those
- 14:56features more.
- 14:57Right.
- 14:57But if you build it well, write indexes on your database and things like that, it should,
- 15:01it should fly.
- 15:01And it should be able to go quite a long ways until you have to worry about that.
- 15:04That certainly seems like a reasonable philosophy to me.
- 15:07The other one is, you know, I do training and write courses and do other presentations to
- 15:13helping people learn things like web programming.
- 15:15And it's super overwhelming.
- 15:17As you know, I mean, you learned when you're young, so maybe it didn't feel as overwhelming.
- 15:20You just like, you just like, this is how computers are.
- 15:23This is what I do.
- 15:24Right.
- 15:24That's probably, that's probably right.
- 15:25But there's HTML, there's CSS, there's databases, there's query syntax, there's Python, there's
- 15:32the templating language, there's Linux, there's deployment.
- 15:34I mean, there's just so many things, right?
- 15:36And if you say, oh, by the way, why are you trying to learn all this for the first time?
- 15:39You know, you need to learn asynchronous programming too.
- 15:41So don't forget about that.
- 15:42I mean, that's a tricky level.
- 15:44I feel like certainly that's, it's a really great thing to have for a web framework, but
- 15:49it is not necessarily a great starting point.
- 15:52Right.
- 15:52Yeah.
- 15:52And that's what I would say on that.
- 15:53tool that you should reach for if you need it.
- 15:55But it's not something that you should default to just because it handles more requests per
- 15:59second.
- 16:00That's my take on it.
- 16:01Cool.
- 16:01Yeah.
- 16:02So I do see like quite a number of those that I mentioned, like Starlette and Sanic and whatnot,
- 16:06focusing FastAPI or whatever, focusing on this async aspect.
- 16:10But another aspect that I see being used a lot is things like type annotations and some of the other Python 3 features to try to make some of those features help with the web framework, for example.
- 16:22Does Masonite do any of that?
- 16:24We'll probably talk about this when we get into the Masonite part.
- 16:27Masonite has something called an inversion of control container, an IOC container or a service container, which utilizes type hints.
- 16:36And the short answer, and we'll do the long answer later.
- 16:38The short answer is basically in the controller code and the controller method, you can type hint a class and Masonite will inject that class for you.
- 16:47Right.
- 16:48So like this controller takes a database derived class or whatever, and then you say that as a type hint, and then the IOC container will like push that in for you.
- 16:57Exactly right.
- 16:58Yeah.
- 16:58If you do like a sort of like a base class or something.
- 17:01So if it's an instance of a database base class, then inject the base class or the database driver that you have defaulted or something like that.
- 17:09Right.
- 17:10What if you've registered?
- 17:10Yeah.
- 17:11Okay, cool.
- 17:12Yeah.
- 17:12Yeah.
- 17:12So I think this is kind of unique and new that so many of these like last couple of years frameworks have really tried to embrace Python 3, right?
- 17:21Like Python 3 has been a struggle for Flask.
- 17:24They're not there anymore.
- 17:25But like for a while, they had a statement saying basically, we don't work on Python 3.
- 17:29Well, we probably work on Python 3, but we don't guarantee it.
- 17:32Something to that effect.
- 17:33Like four years ago or something like that's pretty rough statement given, you know, the date that it was.
- 17:38And then, you know, Django as well, just and 2.0 drop support for Python 2.
- 17:43So, you know, they've been kind of carrying that baggage around.
- 17:48They can't do things like this with their API, right?
- 17:51If you fundamentally said you must have type-ins, well, you know, there goes your Python 2 support, right?
- 17:55Straight away.
- 17:56So all these new ones, though, they seem to be coming along with like a fresh look.
- 18:01So I think that's pretty cool.
- 18:02Masonite, I noticed that a lot.
- 18:05So like it's pretty hard to support multiple versions of Python that don't work well with each other.
- 18:13So like, for example, 2.7 and 3.4, for example, to support both of those.
- 18:18So what I wanted to do with Masonite was one, yeah, start with Python 3, but also only default to the latest four versions of Python.
- 18:28So currently we support 3.4567 and 8's coming out soon.
- 18:34And so far the tests work for 8, so that's good.
- 18:37But when 8 comes out, we're going to drop support for 3.4.
- 18:40Yeah, that seems reasonable.
- 18:41Yeah, my philosophy basically is if you really need to create something in 3.4, then you're going to have to use Masonite 2.2.
- 18:49And if you want to use the latest, this way we can sort of keep up with the trends as it goes on.
- 18:53Yeah, well, for the moment, Python is released on an 18-month release cycle.
- 18:58So that gives you like six years of backwards compatibility.
- 19:02That should be enough.
- 19:03Right, exactly.
- 19:04That should be enough, I would think.
- 19:06There's actually a PEP out, I forget the number, by Lucas Lange, to move to yearly releases.
- 19:12But that would still be four years.
- 19:13That should be good.
- 19:14Yeah, yeah, definitely.
- 19:17This portion of Talk Python To Me is brought to you by Linode.
- 19:20Are you looking for hosting that's fast, simple, and incredibly affordable?
- 19:23Well, look past that bookstore and check out Linode at talkpython.fm/Linode.
- 19:28That's L-I-N-O-D-E.
- 19:30Plans start at just $5 a month for a dedicated server with a gig of RAM.
- 19:35They have 10 data centers across the globe, so no matter where you are or where your users are, there's a data center for you.
- 19:41Whether you want to run a Python web app, host a private Git server, or just a file server, you'll get native SSDs on all the machines, a newly upgraded 200 gigabit network, 24-7 friendly support, even on holidays, and a seven-day money-back guarantee.
- 19:55Need a little help with your infrastructure?
- 19:57They even offer professional services to help you with architecture, migrations, and more.
- 20:02Do you want a dedicated server for free for the next four months?
- 20:05Just visit talkpython.fm/Linode.
- 20:09I'm really excited about all these web frameworks, Mason and I included.
- 20:12However, I have this new problem, right?
- 20:16I could go and look and see Flash Django Pyramid.
- 20:19Let me compare those and sort of see the things I like or don't like about them.
- 20:22And then I can look at history and say, well, it's probably this much supported, so it's probably going to be about that much market share in the future.
- 20:31Flask is about 40%.
- 20:32There's a good chance Flask is going to be around next year.
- 20:36But I don't get that sense with these new frameworks, right?
- 20:39Like, Responder was cool.
- 20:41I don't know if anything has even been done with Responder in the last, you know, little bit, right?
- 20:47It seemed like not a whole lot had been going on with it.
- 20:49It took off in like the first like two months and then it sort of died out.
- 20:52Exactly.
- 20:53I mean, it is super cool and it's great that people are working with it.
- 20:56But how do you think about going through these frameworks?
- 21:00I mean, obviously, you're just working on Masonite.
- 21:02So you're just, you know, going forward and keeping things going.
- 21:04But what would you say to people out there about how they should consider the stability of one of these projects?
- 21:09Is this like a super cool one month idea or is this an actual thing?
- 21:13Masonite itself?
- 21:14Oh, yeah.
- 21:15It's definitely an actual thing.
- 21:16I always sort of think about what Masonite is going to like.
- 21:19Masonite is really, really cool now.
- 21:20But what is it going to look like in five years?
- 21:22Like, what is that Masonite going to look like?
- 21:24And I sort of work towards what that's going to look like.
- 21:27And then maybe in five years, I'll look for another five years and do the same thing.
- 21:30But basically, what I really like about the PHP ecosystem is that a lot of the time, these frameworks, like if you look at Symphony or Laravel, there's faces to them.
- 21:43There's people that you can, there's like leaders, you know, like even Django is sort of like, I don't know if it's just me, but it's sort of like this nameless, faceless organization type thing that like, like maybe like this Marvel type organization that like controls like Django.
- 21:58Like, I think it has like a committee and stuff, but there's not like one specific person that I know, like, oh, they own it or something like that.
- 22:05And like with Laravel, like the guy, Taylor Outwell, you know, he's all about Laravel and, you know, he works on it full time, obviously.
- 22:10But I can look at him and I could look at his future and tell the future of Laravel.
- 22:15So like me personally, like Masonite is going to be around for like a super, super long time.
- 22:20It's, this is basically, Masonite is going to turn into my side project that turns into like, you know, that business.
- 22:27Like for example, maybe that text, what that textbook rental service might've turned into.
- 22:31That's going to be what Masonite is.
- 22:33So, you know, once Masonite becomes profitable, either through sponsorships or partnerships or basically SaaS is around it, it'll just take off from there.
- 22:42But I mean, Masonite is going to be around for super long time.
- 22:44That's awesome.
- 22:45One of the metrics I use is when I go to these projects, obviously I look at how many stars does it have, but also, you know, maybe when was the last commit?
- 22:54Is that three years ago or is that two days ago or an hour ago, right?
- 22:58Like, what does that look like?
- 23:00The other one is, probably the biggest one for me is open PRs that are not being addressed or barely are being addressed.
- 23:10That seems like a real big red flag to me, right?
- 23:12If you go there and there's like five people who have put a bunch of work in to add some new features and they're just, all you got to do is just verify this is all right.
- 23:19And then just accept it and the people running the project can't even be bothered to respond to it.
- 23:24As a contributor, that's a crappy feeling, but also that's not a super good sign for the project, I don't think.
- 23:31That's right.
- 23:31Yeah.
- 23:32So the reason I bring this up is when I go to Masonite, there's zero open issues and there's zero open PRs, which is pretty cool.
- 23:41So here's like the weird thing with Masonite and maybe in future versions, this will be different.
- 23:46But Masonite is really broken up into two different repositories.
- 23:50So there's the Masonite repo that everybody goes to and they see has a thousand stars, but like people talked me into, actually, did people talk me into this?
- 23:59I'm not sure.
- 23:59But at one point I extracted all of the framework itself logic out and I just created an application.
- 24:06So people can basically, when people run their craft commands and they run craft new project and it creates this project down, it actually creates that, basically a copy of that repository down onto their computer.
- 24:17But if you look at, if you go to the Masonite organization and you go to the core repository, you can see the actual core code.
- 24:22That's the actual real code.
- 24:24Okay.
- 24:24Got it.
- 24:25Yeah.
- 24:25That's the actual, what's actually driving the Masonite application.
- 24:28Basically the Masonite that you see on the one with a thousand stars is basically just a shell of Masonite that I took all the, basically the framework code out and I made it in its own repository.
- 24:40And then I made that a package that the shell basically requires.
- 24:44So I basically, what I really wanted to do was take out as much.
- 24:48So when I first posted Masonite on Reddit, it was at like one version 1.3 and everybody hated it.
- 24:54And they said it was crap and it was dumb.
- 24:56You know, typical Reddit stuff.
- 24:59But the weird thing is that they were right because the original version of Masonite was like a basically one function that like did everything.
- 25:07So basically from there, I extracted all the logic out and I kept that repository up because I had so many stars already.
- 25:14I had like a hundred at the time or something.
- 25:15And I basically created a new package and tried to make it as modular as possible.
- 25:22Yeah.
- 25:22That makes a lot of sense.
- 25:23That sounds cool.
- 25:24Seems like there's at least activity on, you know, all the various items there, which is pretty cool.
- 25:30Right.
- 25:30It's not like three years ago.
- 25:32There's a lot of activity over there.
- 25:33Hanging out there.
- 25:33That's good.
- 25:34All right.
- 25:34So maybe we could dig into some of the features of Masonite.
- 25:37You talked a little bit about why you started it, but maybe give a little bit of clarity on that.
- 25:43And then let's just talk about some of its major features.
- 25:45Like why would people choose it over the other frameworks and what were some of the goals there?
- 25:49So I needed a winter project because I was going, you know, in college.
- 25:53So I went to recess.
- 25:54I needed, you know, something to do because I'm home all day and programming is a passion.
- 25:59I can't just sit home and not do anything.
- 26:01So I need to code something and I didn't really have anything to do.
- 26:03So, and I was going through my year of learning frameworks.
- 26:06So I was like, you know what, let me learn how to, you know, build a framework.
- 26:10And so I looked up, you know, how to build a Python framework because that would be cool because the Laravel, I mean, the PHP ecosystem seems, was seemed to be too hard of a competition to penetrate.
- 26:21Yeah.
- 26:21And I saw a lot of holes that I tried to fill with Masonite in the Python community.
- 26:25So I thought it'd be good to build a Python framework.
- 26:27And getting a WSGI server takes like maybe seven minutes to set up and running and getting some kind of response.
- 26:34You're in some kind of dynamic response, which is probably why so many pop up.
- 26:38Right.
- 26:38So you're basically, there's like one function you implement.
- 26:41There's, they pass you the request and you return the response or something along those lines.
- 26:45Yeah, exactly.
- 26:46Yeah.
- 26:46Yeah.
- 26:46It's just a, it's just a normal WSGI application that takes two variables and then you basically return.
- 26:52You use one to set the headers and then the other one to return the response.
- 26:55Super simple.
- 26:56So from there, I basically had it up and running and I was like, okay, well, I'm coming from Laravel.
- 27:01So I think it would probably be cool to write my routes in something I'm familiar with if I'm going to start building this framework because I don't want to learn something new even though I'm building it.
- 27:11So I took what I'm familiar with and I made the routes look like the modern day routes that they are now.
- 27:16And I added that feature in and I was like, oh, that's pretty cool.
- 27:20I mean, I wonder if I could add like controller logic too.
- 27:23Like that'd be, that'd be cool.
- 27:24And so I added the controller logic and the methods and, you know, swapping between different methods and calling certain classes.
- 27:30I was like, oh, that'd be cool.
- 27:32And I was like, what if I had something like super awesome, like, like built-in email sending support?
- 27:36So like I built that in and then I tried to build it all modular.
- 27:39And I basically just went from there, like a little, little bit by a little bit.
- 27:43I just kept on putting more and more features in until just like out of nowhere, people started joining the community and like contributing actually.
- 27:51And we basically, we teamed up me and me and a couple of early adopters and we built into something really, really cool.
- 28:00And then we released 2.0 on June of 2018, I think.
- 28:06And then from there, it just shot up.
- 28:08It went from like 80 stars to like 500 in like a couple of days.
- 28:11Wow.
- 28:12That's cool.
- 28:12Yeah.
- 28:12Featured in the right places.
- 28:14A lot of people came to check it out, huh?
- 28:15Yeah.
- 28:16I basically, I think I put it on Reddit and it got like 20,000 views in like three days.
- 28:20And it was on the top of our Python and it was on like Hacker News, I think.
- 28:24And it got like a whole bunch of, you know, tweets and stuff like that and people talking about it.
- 28:29And it basically shot up from there.
- 28:30Yeah.
- 28:30Super.
- 28:31You started out this conversation by talking about routes and the routing mechanism and controllers.
- 28:37So let's maybe dig into the code story around that a little bit.
- 28:41Now, talking about code in audio format is kind of not the easiest thing to do.
- 28:46But if we keep it simple enough, I think we can give people an idea.
- 28:49So it looks like you have some pretty interesting ideas around creating routes.
- 28:54And it looks like you are sort of embracing this HTTP verb type of world as well.
- 29:02Right?
- 29:02So if I'm going to create some routes, I would go and create a, I would import a get.
- 29:07Is that a class that I'm creating?
- 29:09Or is that a function I'm calling?
- 29:10No, that's a class.
- 29:11A class.
- 29:12So I would create like a list of classes and I would say get like a forward slash.
- 29:17And then I would say welcome controller at show.
- 29:21So the welcome controller is a class that is handling this request and show is a method
- 29:27within it.
- 29:27Or maybe welcome controller is just a module.
- 29:29I don't know.
- 29:30You could name it and so on.
- 29:31No, that's correct.
- 29:31Yep.
- 29:32Yeah.
- 29:32So I can create these gets and posts and it seems like a really nice way to build up
- 29:36from sort of naturally understanding HTTP verbs and the way the internet and websites actually
- 29:42work.
- 29:42Something early on in Mason, and really in my code in general, even when like I create my
- 29:46method names, these method names are like, it seems like a whole sentence long.
- 29:50Because I like when I read my code, I like to read it in English.
- 29:53Like I like to read it from left to right as if I'm thinking it and I want to show it to
- 29:58like a little kid almost and like have him understand it basically.
- 30:03Like it's just reading.
- 30:04It's like reading a book almost.
- 30:06So originally it was actually normally it's get.
- 30:09And then inside the get, you have the URL that you want to send to, like you said, and then
- 30:13the controller method.
- 30:14But previously it was actually get.route.
- 30:17So when I read it, it was, I want to get route.
- 30:22And then I pass in the URL and stuff like that.
- 30:24And you can still do that actually.
- 30:25But we basically shortened it down to, yeah, just a list of get routes, post routes, option
- 30:31routes, put routes, delete routes, stuff like that.
- 30:33That's super cool.
- 30:33How do you pass variables in through the URL here?
- 30:37So I don't see any examples of that.
- 30:39Like if I do this show, I probably want to show like, you know, slash some blog post with
- 30:47the URL or something like that.
- 30:48Yep.
- 30:48So in your URL, it would be, say you want to do like a slash blog post slash maybe one
- 30:53or a two, or you want that to be a dynamic.
- 30:55Sure.
- 30:56That'd be, that'd be fine.
- 30:57It would be slash dashboard.
- 30:58And then you would do another slash and then an at symbol.
- 31:01And then the name of the variable that you want to retrieve later.
- 31:05So maybe it's blog ID.
- 31:06So it would be blog underscore ID.
- 31:08And then you'd put that there and then that's, that'll be the dynamic part.
- 31:12Or you can add sort of what I call regex compilers, which is basically, maybe I only want that
- 31:18to be an int.
- 31:18So it would be at blog ID colon int int.
- 31:23So it'll only match integers or I could do strings or I could do some kind of super complex
- 31:29one where I do like a website.
- 31:31And then I could actually pass a website in with slashes as well.
- 31:34And it'll actually match that as well.
- 31:36Yeah.
- 31:36You can do a lot of complex things with it.
- 31:38I love that, that simple way of doing constraints for types and stuff.
- 31:41Yeah.
- 31:42You create really nice things like on our website, you can say talkpython.fm/ two, three,
- 31:47three, I think would be this episode, right?
- 31:50If I got the number right.
- 31:51And that would actually only match for integers and then it'll go look that up and take you
- 31:55to the real location.
- 31:56So it's like a really nice way to create short sort of CLI almost feels here.
- 32:02Web app.
- 32:02Yeah, exactly.
- 32:03I try to write everything first.
- 32:05So I actually, when I created the routing engine, I actually wrote down, I don't know,
- 32:07piece of paper, every single variation I could possibly write for a routing engine.
- 32:12And then I basically crossed out all the crappy ones that I thought looked ugly.
- 32:16And I only went with the one that looked nice.
- 32:18And then I worked backwards to the actual implementation.
- 32:21Like I had no idea how I was going to create this thing.
- 32:24But then I worked backwards to actually creating the class and creating all that stuff.
- 32:27That's how I actually write almost everything.
- 32:29I want to use it this way.
- 32:30I don't really know how.
- 32:32Right.
- 32:32We're going to make this happen somehow.
- 32:33That's cool.
- 32:34The other thing that you have here is you have classes.
- 32:37And the classes like capture the request object.
- 32:40And then you have the methods that run for the view.
- 32:43And I actually really like this pattern.
- 32:44I use this pattern in some of my websites as well, even though I have to kind of fight
- 32:49against the grain a tad bit to make it happen.
- 32:51I really like it.
- 32:52And you have the word controller.
- 32:54Do you consider Masonite a model view controller framework, a model view template?
- 32:59I don't really even understand why there's a distinction between those things.
- 33:03But it seems to be in the Python space there is.
- 33:05So I do consider Masonite an MVC.
- 33:08But it's not.
- 33:09I try to make it not constrained to just control logic.
- 33:12So I try to sort of assist the developer who's working with Masonite to sort of take a lot
- 33:18of that logic and add, you know, extract it into like maybe like a mail class, which is
- 33:24ejected into the controller and stuff like that.
- 33:26So it's not a strict MVC, but it does use basically the wording to sort of help you
- 33:31structure your code.
- 33:31I like that pattern.
- 33:32It's cool.
- 33:32You talked about the injection stuff and I do want to cover that.
- 33:35That's fairly unique in the Python space.
- 33:38But before we get there, so the way that I would, if I was a Masonite developer and I
- 33:45was starting a new web app based on it, I would create a virtual environment and I would pip
- 33:49install some stuff, Masonite and whatnot, right?
- 33:51And then I would start issuing command line or CLI behavior commands to Masonite to help scaffold
- 34:00build up and start building my app.
- 34:01So you could say you have this utility called craft.
- 34:06Tell us about craft and some of the commands and what's the story on that?
- 34:09I think it's incredible, actually.
- 34:10I think that's actually what makes or breaks the framework.
- 34:12So craft commands.
- 34:13So think of like Django, because a lot of your listeners are probably familiar with Django.
- 34:17So in Django, you might have a class based view and you might have that, you know, return a couple of templates, maybe some kind of context and stuff like that.
- 34:26And then you want to create another one.
- 34:28We usually end up doing is you either maybe create a new file and then instead of creating the whole class, you probably sort of copy and paste that old one that you already created into the new one.
- 34:37Yeah, certainly a copy and a paste is a solid start.
- 34:39Yeah, exactly.
- 34:40So what craft does is it gets rid of all of that boilerplate.
- 34:45So in Masonite, if you want to create a new controller with, you know, a couple of imports and you want to import the request class, the view class, you want to create a method.
- 34:54What you do is you do craft controller and the controller name.
- 34:57So maybe craft controller blog.
- 34:59And it'll actually create you a blog controller.
- 35:02It imports the request class, it imports the view class.
- 35:05It makes a default show method and it type hints the view class and it type hints the request class.
- 35:10Like it creates all that boilerplate for you.
- 35:11And it does the same thing.
- 35:13Like if I want to create a middleware, craft controller middleware, it creates me a class, imports everything I need.
- 35:17What's an example of middleware?
- 35:19Like why would we, why would I create one of these things?
- 35:21What does it do?
- 35:21A middleware?
- 35:22Yeah.
- 35:22In the Masonite terminology.
- 35:23So a middleware is basically a piece of functionality or code that runs in between the request class or in between the incoming request and your controller method.
- 35:34So for example, maybe you want to have some kind of authentication.
- 35:37So if the user is not logged in, I don't even want to hit the controller.
- 35:41I just want to redirect to the login page.
- 35:43So I might create that.
- 35:44Or maybe I want to create some kind of after middleware.
- 35:47Like I want to take the HTML response and maybe minify it and then return it.
- 35:53Something like that.
- 35:54So you create these middleware that run in between your controller, in between the incoming request in the controller, and then in between the controller and the final response.
- 36:02And you sort of inject these things.
- 36:04That's actually really, really simple to work with, with Masonite.
- 36:07But yeah, you just use these craft commands.
- 36:09You can create, you know, migrations.
- 36:10You can create jobs.
- 36:11You can create listeners and tasks.
- 36:15And you create all these things, all this boilerplate.
- 36:17So the objective really is that I don't want to focus on writing things that aren't crucial to my application.
- 36:24So if I have a thought that says, all right, I need to start sending out an email.
- 36:28Let me make a new controller or something like that.
- 36:30I just create the controller and I go to the controller and I'm still focused on sending out my email.
- 36:35I drop down to the method and I start coding, sending out my email.
- 36:38Like I never break my train of thought with what I actually need to do to get my business logic set up.
- 36:43That's cool.
- 36:43And it seems like it follows some really nice conventions.
- 36:46So for example, you said maybe we want to create a blog controller as a show method.
- 36:50So you would say craft controller blog, but it actually creates the controller, a controller class called blog controller, not just blog.
- 36:59It puts it in slash app slash HTTP slash controllers, and it initializes it all correctly, right?
- 37:06It has an initializer, which has a type, you know, request object that has a type annotation of requests and things like that.
- 37:12Yep, exactly.
- 37:13This portion of Talk Python To Me is brought to you by Datadog.
- 37:18Datadog is a monitoring and analytics platform that unifies metrics, logs, and distributed traces from your Python applications.
- 37:25Datadog's tracing client auto instruments popular frameworks and libraries such as Django, Flask, PostgreSQL, and AsyncIO,
- 37:32so you can quickly get deep visibility into your applications.
- 37:35Trace requests across service boundaries, correlate traces with logs and metrics,
- 37:40and plot your application architecture with the service map.
- 37:43Get started today.
- 37:44Sign up for a free trial at talkpython.fm/datadog, and Datadog will send you a free t-shirt.
- 37:52Yeah, one of my pet peeves around some of these projects is they give you zero guidance about any organization.
- 38:00And maybe even taking it farther, like sometimes they even accentuate their ability to not have any organization or any structure.
- 38:08Like, look, you don't even need that.
- 38:09Look, you don't even need one file.
- 38:11Just like put it in this file, and you're good.
- 38:13This is where it goes.
- 38:14It all just goes in here.
- 38:15And like, no, it doesn't all go in there.
- 38:17You're going to have, you know, so many view files or controller files.
- 38:23You have, you know, 50 templates.
- 38:24Like, you need organization.
- 38:26And this, like, selling the lack of it as simplification seems to me like pushing at least beginners down, like, the wrong path.
- 38:35Right?
- 38:35So I like that your craft commands take, like, a natural structure and just say, this is the convention we use, and we're just putting it here.
- 38:43Right, exactly.
- 38:43And like you said, it creates that file, and then it puts that controller in it.
- 38:46But it's only that one class.
- 38:48And that is opinionated.
- 38:50That is the way I like to work, mainly because in my VS Code editor, if I need to go to my authentication middleware.
- 38:59In order to do that, you know, I hit the command P thing, and I go to authentication middleware, and I click enter, and I go to that specific class, that specific method.
- 39:07I'm not, like, going into, like, some kind of middleware.py file, scrolling down a couple hundred lines so I could find that middleware class or anything like that.
- 39:14Yeah, yeah.
- 39:15So it's just the way I code.
- 39:16I just hop around files, you know, all day until my app is done.
- 39:20Man, I'm with you.
- 39:21I love it.
- 39:22That's the way to do it.
- 39:23Having, like, these huge long files with everything crammed in there, it just means it's so hard to find.
- 39:28I think the choice of editor somewhat influences the granularity of, that you're comfortable with here.
- 39:34But I'm kind of, it sounds like you and I would have a similar style.
- 39:38Yeah, exactly.
- 39:39Like, I feel like it's almost like when you give a kid, like, a guitar, and he grows up to be a rock star.
- 39:44Like, whatever sound that guitar made is probably what kind of rock he's going to play, you know?
- 39:49So, like, it's almost like that.
- 39:51Like, whatever editor you use probably dictates what kind of applications you're going to build.
- 39:54Right, right.
- 39:55Something like VS Code is very natural at handling many directories, many files, and, like, seeking between them really quickly.
- 40:00Right.
- 40:01The other thing that you talked about when you talked about that flow there was injecting things.
- 40:07Now, I definitely think dependency injection and the open-close principle and all those things have some really interesting places in the Python world.
- 40:16But I also don't see them used very often.
- 40:20So, this is kind of a unique aspect of it, of what you're doing.
- 40:24But so, for example, like, if I've got my show method from my blog, and maybe in order to get my blog, I have to go to my database.
- 40:31And I want to work with MongoDB.
- 40:33So, somewhere previously at the app startup, I said, when I asked for a database, give me the MongoDB implementation of my repository thing or my database service or whatever I called it.
- 40:43Right.
- 40:43So, I can go to that view method and say, you know, like, show self, comma, view, colon, view, comma, DB, colon, repository or database class or database service.
- 40:55And then I'll just automatically just start getting my database instance passed into me by Masonite.
- 41:00Yep.
- 41:01That's exactly right.
- 41:01Or what you can really do, where Masonite really shines is being able to basically swap out what I call interfaces or contracts.
- 41:11So, like one of the other principles, interface segregation principle, right, where you want to really code to an interface and not to a concretion.
- 41:18Yeah, we can hit all the solid principles.
- 41:19Right.
- 41:20Yep.
- 41:20So, what you can do is you can, Python doesn't have like an implements keyword or anything.
- 41:24But if you have like a base class, say you have a, what would be a good example, like a payment base class, you can type in that.
- 41:33Yeah, payment service, whatever.
- 41:34Sure.
- 41:34Right.
- 41:34Yeah, payment service.
- 41:35So, you type in payment service.
- 41:37And even though you have no classes called payment service, it'll find an instance of payment service and return that as well.
- 41:44Right.
- 41:45Maybe you wrote a class called Stripe payment service and it drives from payment service and it actually talks to the Stripe API or something like that.
- 41:50And it'll just find that and inject it.
- 41:52Yeah, exactly.
- 41:52And what's even better, I think, is that, and this might sound confusing to people who don't understand IOC, but what also it does is when it resolves that payment service class, it'll resolve whatever is in the initializer of the payment service class as well.
- 42:09So, basically ties every single class that that payment service relies on, ties it all together, initializes everything, and then returns everything as an object already set.
- 42:22So, you don't know longer do you have to sort of import a class, maybe get some config variables, maybe pass it in, construct that thing, and then pass that thing into something else that needs it.
- 42:33Everything just ties together sort of seamlessly.
- 42:36And then you can also swap out functionality as well.
- 42:39That's really what powers an IOC container.
- 42:41And the funny thing with Python and IOC is that even if you Google, why doesn't Python have an IOC implementation or something like that?
- 42:48I forget the Google question.
- 42:51But you go there and it says, you don't need an IOC container.
- 42:54I think it's like because Python is like duct typed or something.
- 42:58Like it was, it almost like made no sense.
- 42:59Like, like that's not really the reason for an IOC or anything like that, or even for like interfaces or anything.
- 43:05So, it was very strange.
- 43:07But I think IOC is more of a architectural decision that just, you have to build applications.
- 43:14Like we're building this large scale ERP system at work.
- 43:17There's probably going to be a two-year long project, probably thousands and thousands of classes.
- 43:21And like if you didn't have an IOC, like how do you manage all those dependencies between the classes?
- 43:27Like it's crazy.
- 43:27It gets tricky.
- 43:28That's for sure.
- 43:29I would say for sure that Python does not, as a general rule,
- 43:35the people in the community and the libraries don't generally embrace IOC.
- 43:39But yeah, I see it being really useful here.
- 43:42So, that makes a lot of sense.
- 43:43You know, like your payment service, your Stripe one also takes a logging framework or logging service.
- 43:49And it takes a database service or something like that, right?
- 43:51Like you just register them all and it all just, you just go to your view and say it takes a payment service
- 43:56and you get the Stripe service all set up.
- 43:57As long as they're all in the container, they all can communicate with each other.
- 44:01That's cool.
- 44:01And probably use that for testing as well, right?
- 44:03Like you could swap out the database with like a mock database and the logging with like a null logger
- 44:10that actually doesn't do anything or something like that.
- 44:12Like prints.
- 44:13Even Masonite itself is strictly based around this container.
- 44:17So, if you want to change out the request class, for example,
- 44:19and you want to make it a different request class, you could just do that.
- 44:22And everything else will sort of follow.
- 44:24As long as you follow the contract of the class,
- 44:26you could just sort of swap every single piece of functionality out of Masonite and inject your own.
- 44:31That's cool.
- 44:31One of the challenges I've had when working with IOC is I'll be somewhere in the middle of the system
- 44:37and I'll have all these dependencies that were put together by the IOC container.
- 44:41And I'll be like, all right, I have no idea what actual database I have or what logging thing I have
- 44:47or where it came from or any of that.
- 44:49And I do see that as one of the drawbacks of IOC is it's kind of hard to see where it all gets started.
- 44:54Yeah, I mean, I guess if you sort of lose yourself, then I guess you're sort of lost, I guess.
- 44:59But as long as you have like a good file structure and you have like maybe good documentation on your project
- 45:05and stuff like that, you can sort of, there are caveats, I'll admit.
- 45:09But it's definitely a pretty good architecture.
- 45:12Yeah.
- 45:12One of the things I like about your craft commands is, you know, I'm a fan of things like cookie cutter.
- 45:17And I think cookie cutter is a super way to get started, right?
- 45:20Like the right way is not create an empty .py file and start typing it.
- 45:25I don't think like, you know, I already talked about the structure, but there's also tons of static files.
- 45:30There's just, there's a lot of stuff that would be nice if you could start farther from let's enter character one and get going, right?
- 45:37And I think cookie cutter is a nice way to do that, right?
- 45:39You could say, okay, I'm going to use, I'm going to create a flash project that's already using SQLAlchemy.
- 45:44So it's got the requirements set up.
- 45:45It's already got a database structure.
- 45:47It's already got a connection string for SQLite database for getting started and, you know, that kind of stuff, right?
- 45:52What falls apart with a lot of those systems is you get to run them once and that's it.
- 46:00Right.
- 46:01Right.
- 46:01Like I have a super cool.
- 46:02I was just about to say that.
- 46:03Yeah.
- 46:03I have a cool cookie cutter template that will actually generate the final code from this course I have called Python for Entrepreneurs.
- 46:09And it's like super involved.
- 46:11There's so much stuff going on and you can type in the name of your project and whatever and run the cookie cutter.
- 46:16And it will just, boom, out drops this really well formed project that looks just like the final project of that course, but with your data in it, right?
- 46:24The problem is that's great for getting my first controller or whatever is in there.
- 46:30But if I want the second one, cookie cutter is not going to help me.
- 46:32That's where copy and paste comes in, right?
- 46:34It seems like with your craft commands, you can start out building pieces of your app and continue kind of adding to the app with that CLI.
- 46:43What do you think?
- 46:44Yeah, exactly.
- 46:44I mean, every, when you're trying to reach for like a copy and paste, like you're wasting so much time.
- 46:51And not only are you wasting time, but you're, now that you finally copied and pasted it, now you have to be like, all right, wait, what was I trying to do again?
- 46:57Oh yeah, right.
- 46:58Okay.
- 46:58Yeah.
- 46:58Sending email.
- 46:58And then you sort of go back into sending email and it takes your mind off.
- 47:01And it's just, it's just a massive like time suck.
- 47:05And most people that use Masonite, I don't know about most people, but a lot of people that are in the Slack channel, they say, man, like I built this thing in Masonite in three days.
- 47:18It would have taken me three weeks in Django.
- 47:19So I actually get that a lot.
- 47:21It sort of gets to the point where I almost expect it when someone comes from Django or something.
- 47:25I just, I basically just wait for it.
- 47:27And I think a lot of that is because all of that boilerplate code is done for you.
- 47:32Like we already created controllers and if you need to create a job, you create a job, you add your logic and then you just add it to a queue.
- 47:38Like it's takes five seconds.
- 47:40Yeah.
- 47:41It's huge.
- 47:41Yeah.
- 47:42That's cool.
- 47:42So let's talk about some of the other things that you can make with these craft commands.
- 47:45You just talked about jobs.
- 47:47That sounds like an asynchronous thing.
- 47:48Maybe kicking out to some kind of background worker process.
- 47:52You talked about email before we've got views and templates and create templates.
- 47:58So you've adopted the Jinja 2 template system.
- 48:01Is that right?
- 48:02Yes.
- 48:02Yeah.
- 48:02Do you have any other support like chameleon?
- 48:05Hint, hint, chameleon?
- 48:06I don't currently.
- 48:07I know that one guy came to me and he said he wanted to write in pug.
- 48:11I don't know if you ever heard of pug before.
- 48:13No, I only know it as a dog.
- 48:14Yeah, I think it's called, oh no, maybe I just kept on calling it pug, but maybe a pub or something.
- 48:18But anyway, it's basically, it looks like a markdown type style.
- 48:22And he wanted to write in that and it had a Jinja 2 extension.
- 48:26And then from there, I basically added extension support for the views and stuff.
- 48:31So you could write, you could basically write in any Jinja 2 extension language.
- 48:36So it basically just compiles down into Jinja, I guess, and then gets rendered.
- 48:39But as for swapping out that functionality for chameleon, it's possible.
- 48:44But there's no documented way of doing it.
- 48:47Sure.
- 48:47But it definitely could be.
- 48:48You could open an issue.
- 48:49VRs are accepted, huh?
- 48:50Yeah, of course.
- 48:51Nice.
- 48:51Background work.
- 48:52Let's touch on that real quick.
- 48:54That's not something every framework decides to take on for itself.
- 48:57Yeah, definitely.
- 48:58So a lot of the features of Masonite came by me needing it.
- 49:03So basically, I'll basically add it to my application and then I'll try to extract it into a framework feature.
- 49:11And one of the things I needed was sending an email and I wanted to send that asynchronously.
- 49:16So I created the concept of queues and jobs.
- 49:19So a job is basically just a normal, simple class that extends queueable.
- 49:26And you can add your logic of sending an email.
- 49:29Maybe it'll accept a parameter of an email.
- 49:33And then you could take that job and then you could pass it into any queue driver that you want.
- 49:37So if we want to run it asynchronously, we pass it in the asynchronous queue driver.
- 49:41If we want to...
- 49:43And then when I deployed to Heroku, I didn't want to run things asynchronously.
- 49:46I wanted to run things through some kind of RabbitMQ server.
- 49:50So I coded that driver.
- 49:52And the cool thing is that in order to create a new driver, it's just a simple class that needs four methods.
- 49:59And then you take that and you register it to the container and then you have that functionality.
- 50:06So I created the AMQP driver, which is the protocol for RabbitMQ.
- 50:10It took like maybe a night.
- 50:12And then actually last night, I actually created a database driver as well.
- 50:16So now you could take that same job, that email job, adds it to a database table.
- 50:20You have a worker that you run as like a separate process, maybe on like a supervisor process, that will basically pull that database and then run the job.
- 50:30And the cool thing about that is that you can actually delay queue jobs as well.
- 50:34So you can delay it by 10 minutes.
- 50:36Maybe after the user signs up, we'll send a welcome email in 10 minutes.
- 50:39And then you add that and it'll basically, you know, wait 10 minutes and then it'll send the email out.
- 50:45And that's the way I like to sort of counter the ASGI competition.
- 50:50So, you know, going to the next page might take one second or a half a second.
- 50:55But sending that email might take two seconds.
- 50:57But if you send it to a queue job, you know, it only takes that half a second.
- 51:01And then it'll just run in the background or in your queue server or something like that.
- 51:04So I thought that was a really cool feature that I added in Masonite pretty early.
- 51:07And I use it all the time.
- 51:09That's cool.
- 51:09Certainly, asynchronous queues and background work like that do solve a lot of the primary reasons that you need.
- 51:16Some sort of direct async behavior.
- 51:19I do think the database stuff, if you could have it as async, once you, and we talked about it not necessarily being a great place to start.
- 51:25But once you get advanced, like it would be kind of cool.
- 51:28But, you know, my sites don't have it either, right?
- 51:31Like both my database access layer can't support it, nor does the framework support it.
- 51:36And, you know, the thing is super, super fast.
- 51:39Like, honestly, I don't understand why most websites that I work with are so crappy and slow.
- 51:43Because I didn't work that hard to get mine to go fast.
- 51:47Right.
- 51:48It doesn't do that hard.
- 51:49Anyway.
- 51:50But I bet you if it was simple enough, like if you just had to create a job and then add it to the queue, which is already created for you, I bet you probably would do it.
- 51:57Like creating some kind of queue background work, like a lot of Django projects probably don't.
- 52:01I did end up creating this type of thing because certain types of operations might send thousands of emails on the click of a button.
- 52:08And you can't wait for that to happen.
- 52:10Right.
- 52:10It's insane.
- 52:11Right.
- 52:12For example, if I like I have office hours for my courses that people can come, they take the course, they get the office hours for free.
- 52:17A bunch of people signed up for those.
- 52:19Right.
- 52:19If I enter a new one, I can't just wait to send all those emails because it'll time out.
- 52:24But other things like putting people on mailing lists.
- 52:27Right.
- 52:27They signed up for the site.
- 52:28They said, OK, you can put me on your mailing list, but they don't need to wait for you to put them on the mail.
- 52:33There's no outcome from that that they need anything from.
- 52:36Right.
- 52:37Exactly.
- 52:37Right.
- 52:37So that's a perfect example of some kind of background work.
- 52:40And adding background work to Masonite literally takes about maybe 10 seconds of code once you get comfortable with it.
- 52:46I tried to make every single thing as easy, as quick as possible, just to make it like this rapid application development tool that people reach for.
- 52:54Yeah.
- 52:55Cool.
- 52:55One of the things that Django comes with is Django ORM.
- 52:58And that's been really popular.
- 53:00One of the things that Flask and Pyramid have eschewed, they've decided we're staying far away from, is defining a database access layer at all.
- 53:08And it's like up to you.
- 53:10Typically, the answer is go get Sequel Alchemy or something like MongoEngine if you're going to talk to MongoDB or something else.
- 53:16Right.
- 53:16But it's up to you.
- 53:17There's no guidance.
- 53:18It sounds to me like with Masonite, you decided to bring along an ORM, an active record style one, which matches really well with Django ORM.
- 53:28Right.
- 53:28And its style, not so much with Sequel Alchemy, which is a unit of work type of one.
- 53:32Why not just lean on Sequel Alchemy?
- 53:34So again, it was what I wanted it to look like.
- 53:38So I wanted the ORM to look like something I was comfortable with using.
- 53:43And again, Masonite is sort of like a framework for me, right?
- 53:46Like I knew I was going to use it.
- 53:47I didn't want to build it for somebody else.
- 53:49I used it.
- 53:49So I built it in a way that I would like it.
- 53:51And I came from Laravel, like I said.
- 53:54And Laravel has something called an Eloquent ORM, which is another active record style.
- 53:58And then I found Orator, which is pretty feature complete.
- 54:02There's a couple of things that can be added to it.
- 54:04And it was basically influenced by Eloquent.
- 54:06So it was almost like perfect to bring in because it's super sleek.
- 54:09You don't have to like do anything crazy.
- 54:12Like getting all records is like the model name dot all.
- 54:15That's it.
- 54:16That's all you have to do.
- 54:17Getting like where is like dot where.
- 54:19And then, you know, you can maybe change some where's together.
- 54:22To get the first record is, you know, dot first.
- 54:25Like it's very, very sleek.
- 54:26And I thought that was the same as Masonite's philosophy of doing something as quick as possible
- 54:31to get what I need done.
- 54:33And it also had the, what I wanted to do as well was the migrations.
- 54:38So the migrations are really important.
- 54:39So in Django, you have like these magic migrations that are basically, I don't even know how,
- 54:44but they're somehow like taken from like model changes.
- 54:46And it basically generates these things that run that you should like never edit because
- 54:51that's probably bad.
- 54:53And it's probably going to screw up something down the road.
- 54:55Something will get out of sync.
- 54:56Yeah.
- 54:56In Laravel and in Orator, you want to do the migrations.
- 55:00The migrations are much more explicit.
- 55:01So what you're doing is you generate as this new migration and you, you know, add a couple
- 55:08of table columns and there's like an up method and a down method.
- 55:12And the down method just reverses what you did in the up method, which is usually defaulted
- 55:17to like a sensible default, like dropping the table, which is usually what you need to do.
- 55:21And that's what I wanted.
- 55:23And then Orator also had that too.
- 55:24So that saved like a whole lot of time.
- 55:27So it just made sense to go with Orator and I used it and I integrated the migrations
- 55:31process with it.
- 55:32And I just really, really like Orator.
- 55:34I think it's a really great ORM.
- 55:36So then I just incorporated it and everybody else seems to like it.
- 55:40So I guess something's good.
- 55:41It looks pretty interesting.
- 55:42I can certainly see how it goes with your philosophy of, you know, I wanted to look like this.
- 55:49How do I make that happen?
- 55:50Right.
- 55:50It's a little bit, a little bit SQLAlchemy-esque in some ways, but not in others, right?
- 55:56Like the way you define the model and the table names and stuff.
- 55:59That's pretty cool.
- 55:59One of the things I like about some of your philosophies or styles here is you could go
- 56:05and say, get a user.
- 56:06You could say user.find and pass a user ID and that'll give you back the user or maybe none,
- 56:11right?
- 56:11Yeah, it's nice and quick.
- 56:12Or you could say user.find or fail and give the user ID and you either get one back or I'm
- 56:17guessing you get an exception if that didn't work, right?
- 56:19Yep.
- 56:19Yeah.
- 56:20So what I'm using, say SQLAlchemy, SQLAlchemy has a first and it has a one.
- 56:24Which one of those?
- 56:25He's going to throw an exception when it doesn't find it.
- 56:30You know, I mean, probably one, but is one just the way I get the first one or is first
- 56:35the way I get the first one?
- 56:36You know what I mean?
- 56:37There's just, it's just a little less.
- 56:39It's very fluent.
- 56:40Order is very fluent.
- 56:41Obviously, once you get used to it, right?
- 56:43First just gives you the first or none and so on.
- 56:45But this name is super clear and I really like the style of find or fail.
- 56:49Because like I said, like when I write my code, I didn't write order.
- 56:53I'll admit it was already written for me, you know, written, almost written for me.
- 56:56I felt like, but it reads like English and that's how I like to do it as well.
- 57:01Yeah.
- 57:01You also have an interesting way of setting up relationships with decorators and properties.
- 57:05How does that work?
- 57:07Oh yeah.
- 57:07So I think this is, this is actually really cool.
- 57:10So in order, if you have a user and in articles, a user has many articles and then in
- 57:19article belongs to a user.
- 57:20So what you can do is when you do like maybe user equals user.find1 and you get your user,
- 57:26you could do user.articles.
- 57:28And this is called a dynamic property.
- 57:30Even though you created a method called articles and you decorated it with a has many relationship,
- 57:36you fetch it by using this dynamic property.
- 57:39Right.
- 57:39It basically is similar to the app property syntax.
- 57:41And it actually returns a collection of all the, all the articles.
- 57:46Or what you could do is if maybe a user has one profile, which has one address, which has
- 57:54one something else.
- 57:55You could actually, when you fetch your user, you could do user.address.
- 58:00Or user.profile.address.
- 58:02And you could just keep on chaining these relationships.
- 58:04And then eventually you get down to what you need.
- 58:07Or what you do is you do user with profile address, something else.
- 58:14And then you actually, what do you call eager load?
- 58:17And that gets rid of the N plus one problem.
- 58:19That's a big problem with ORMs.
- 58:21And I think some people don't know what that is, what the N plus one problem is.
- 58:26You want to take a shot at describing that for the audience?
- 58:29Because personally, I am a huge fan of ORMs or in the manga world, ODMs for documents.
- 58:35But these classes that map back to your data, I think it's a huge benefit.
- 58:38But this is one of the problems that you need to be aware of.
- 58:41And it can be one of the performance problems.
- 58:43So maybe tell people about this N plus one problem in ORMs.
- 58:46So let's say you get a list of 50 users.
- 58:49And you want to loop through all those 50 users.
- 58:52And you want to get the profile of each user, right?
- 58:56Because that first one where you get the list, that's probably a single query, right?
- 58:59Users.find state equals California or something like that, right?
- 59:03And you get 50 results.
- 59:04So there's your one.
- 59:05There's your one in the N plus one.
- 59:07Right.
- 59:07I'll explain the problem first and then I'll explain the solution.
- 59:10So the problem is if I loop through the user and I did user.profile, it's going to create
- 59:15or it's going to fire a query for each time I use user.profile.
- 59:21And it's going to fire a query.
- 59:22So that's where the N comes in because you're looping through all 50.
- 59:24Now you have 50 plus one queries.
- 59:26And now you have 51 queries.
- 59:28Probably slow to do that, right?
- 59:30It's probably not good to do 51 queries when you could do one.
- 59:33Right.
- 59:33So what you do is you do user with profile find one and that eager loads, which called.
- 59:40So that's two queries.
- 59:42And what that does is it gets the user ID and then it does a where in on the other table.
- 59:48And it basically saves that information basically in memory on that object.
- 59:53So now whenever I do user.address, I already loaded that information.
- 59:58So I just fetch it from some kind of dictionary or something or some kind of collection saved
- 1:00:02on that user object.
- 1:00:03So now it's only ever two queries that I'm doing it.
- 1:00:06So it gets rid of that N plus one problem.
- 1:00:08Yeah, that's perfect.
- 1:00:09And it's super easy to tell if you just turn on logging, right?
- 1:00:13You could tell you have an N plus one problem because you're like, whoa, why is, if you turn
- 1:00:17on logging to like every time you do a query, you show me what's happening going to the
- 1:00:21database, you're like, I hit this one page and there's like 20 queries.
- 1:00:25Why this should be one or two?
- 1:00:27What is happening, right?
- 1:00:28That's probably an N plus one problem.
- 1:00:30Yeah, I've gotten about 750 queries down to like 13 or something like that using like the
- 1:00:36with statements.
- 1:00:37Yeah, it's pretty crazy.
- 1:00:38That's pretty sweet.
- 1:00:39All right, Joe, I think we're getting long on time here, but this has been really fun.
- 1:00:44It's clearly an opinionated framework, but I also like that you can use these craft
- 1:00:50commands to kind of bring in bits and pieces as you want to or not.
- 1:00:53That's cool.
- 1:00:54Yeah, thank you.
- 1:00:55Yeah, you bet.
- 1:00:55All right.
- 1:00:56So let me just ask you one really quick question, I guess, around the project itself before we
- 1:01:02move off of it.
- 1:01:02So are you looking for contributors?
- 1:01:05People do like take it for a run?
- 1:01:08People to add issues, add PRs?
- 1:01:11Where's it at?
- 1:01:12Yeah, I mean, we're looking for contributors all the time.
- 1:01:15I mean, you could be a contributor by joining the Slack channel and saying like, hey, you
- 1:01:19should have this feature.
- 1:01:19And then I'll probably, you know, either code it that night or maybe a couple days later or
- 1:01:24that weekend.
- 1:01:24That's even contributing.
- 1:01:26I mean, you didn't code, but you still contributed towards the development of the framework.
- 1:01:30And Masonite's in a really unique position because it sort of is opinionated and it is
- 1:01:34a Python framework.
- 1:01:35So it has a lot of people coming in from different ecosystems.
- 1:01:38Like people feel really comfortable coming from Ruby.
- 1:01:40People feel really comfortable coming from Laravel.
- 1:01:43People love it coming from Django.
- 1:01:45So when they come in, they have all these like really, really unique ideas.
- 1:01:48So if you're not even in the Python community, I mean, that's, I think that's even better coming
- 1:01:53in because you're coming with fresh ideas that maybe people from the Python community don't
- 1:01:57have yet or haven't seen.
- 1:01:58So yeah, just joining the Slack channel is huge to come in.
- 1:02:03If you know how to code or you go to a Python, that's great too.
- 1:02:06Yeah, that's cool.
- 1:02:07How old is Masonite?
- 1:02:08So Masonite was developed, it started December of 2017.
- 1:02:12And then in six months later, we came out with the main release, which was June of 2018.
- 1:02:19So it's probably about, what is that?
- 1:02:22Probably really only a year and a half old is really when it really started kicking off.
- 1:02:26Cool.
- 1:02:27The reason I ask is a lot of these other web projects in the Python space are very old,
- 1:02:31right?
- 1:02:32They, they've been around since 2005 or 2008 or something like that.
- 1:02:36And as a contributor, if you want to participate in that, you're walking up to a highly polished,
- 1:02:41careful, delicate balance of features and things and so many people depending upon it.
- 1:02:46And if you want to make a change, it can be really hard to do minor things, right?
- 1:02:50So these newer frameworks, I feel are maybe better opportunities for folks to contribute
- 1:02:54because it's somewhat newer, right?
- 1:02:57And it's a little more dynamic and flexible and it's not so set in stone.
- 1:03:02Yeah, I think that's exactly right.
- 1:03:03And even the Masonite code in general is super, super clean.
- 1:03:06Almost every single method is, has doc strings that explain and where each variable comes from
- 1:03:12and stuff like that.
- 1:03:13So it's really, really easy to contribute.
- 1:03:15And since it's fairly new, although it has like a crap ton of features and people actually like are really,
- 1:03:22really impressed that it's only, you know, a year and a half old and it has dozens and dozens of features.
- 1:03:26There's a lot of easy picking still that can be coded up.
- 1:03:29So there's even in the issues, I usually put good first issue or I list a difficulty, easy, medium, hard.
- 1:03:37I haven't done that actually with the latest issues, but normally I do that.
- 1:03:41So if you want to hop in and see what kind of difficulty you're at and then go there.
- 1:03:45Yeah, you can decide, oh, actually, this might be more than I want to spend to get started in this.
- 1:03:49The other thing that is interesting and I noticed about your project is you're participating in the GitHub sponsor program.
- 1:03:57I don't know if that's the right name for it, but it's something to that effect where folks can contribute through GitHub to Masonite, right?
- 1:04:04Tell people about that.
- 1:04:05So I think with that button that you see, that little sponsor button, it's really, I think it is called the GitHub sponsor button,
- 1:04:11but it's really just a list of other links.
- 1:04:14It's really just a button and then you could post links to like a Patreon or some kind of like patronage service.
- 1:04:23So it's not anything crazy, but if you click on it, it'll show you the link to the Patreon page where you can either sign up to be a contributor.
- 1:04:29If you're a company and you want to sponsor, the documentation page gets, I think, around 10,000 page views a month.
- 1:04:35So if you want to go there, it's always good to contribute there as well.
- 1:04:39Very cool.
- 1:04:40All right.
- 1:04:41Well, let me ask you the two questions before I let you get out of here.
- 1:04:44Now, I think astute listeners will already know the answer to this question, but that's okay.
- 1:04:49I think we kind of touched on it already.
- 1:04:51But if you're going to write some Python code, what editor do you use?
- 1:04:54VS Code.
- 1:04:54Yeah.
- 1:04:55That's a good one.
- 1:04:56That's definitely got a lot of momentum behind it right now.
- 1:04:58Yeah.
- 1:04:58And then notable PyPI package that maybe you ran across or maybe Masonite depends upon.
- 1:05:05You're like, this thing is awesome.
- 1:05:06It doesn't get enough attention.
- 1:05:07Maybe tell people about something like that.
- 1:05:09Like, first of all, just to get out of the way, you can pip install Masonite as a thing, right?
- 1:05:13Yeah.
- 1:05:14So there's one notable package.
- 1:05:15Can I say my own package?
- 1:05:16Like a different package that I created?
- 1:05:18If you want.
- 1:05:19Something that I created as sort of an extension is called Masonite validation.
- 1:05:23I needed, again, something extremely simple to create.
- 1:05:27So to create validation.
- 1:05:29And I didn't really see anything that was simple.
- 1:05:31I saw like, I think something's called pillow or marshmallow or something.
- 1:05:34It just wasn't what I wanted.
- 1:05:36So I created this validation package.
- 1:05:38And you could see it in the Masonite organization on GitHub that you could bring in.
- 1:05:41And it's not just for Masonite.
- 1:05:43It's for any, it's for Django or Slack or anything.
- 1:05:45So you could pull it in.
- 1:05:46It'll only pull in the validation part of Masonite.
- 1:05:49And you can validate dictionaries.
- 1:05:52You could validate multidimensional dictionaries.
- 1:05:54You validate, you know, JSON responses and stuff.
- 1:05:56It's a really, really cool package.
- 1:05:58Okay.
- 1:05:58That sounds really nice.
- 1:05:59All right.
- 1:06:00Final call to action.
- 1:06:00People are maybe interested in checking out Masonite, interested in getting started.
- 1:06:04What would you tell them?
- 1:06:05So if you go to the main GitHub page, github.com/Masonite framework slash Masonite, you'll
- 1:06:11see a link to the Slack channel.
- 1:06:12Yeah.
- 1:06:12And I'll link to that in the show notes as well.
- 1:06:14Yeah.
- 1:06:14I'll link that in the show notes.
- 1:06:15Yeah.
- 1:06:15The Slack channel, which is, I'm really, really responsive.
- 1:06:20It's about, it's almost 350 people in that Slack channel so far.
- 1:06:23Everybody's really, really friendly.
- 1:06:25So you can join there.
- 1:06:26And then on Twitter, at Masonite Project, I post news and tips and tricks and stuff like
- 1:06:34that on Twitter as well.
- 1:06:35So if you want to learn Masonite on Twitter, then you can join there.
- 1:06:38All right.
- 1:06:38Well, it looks like a cool framework and it has a really unique way of working with it,
- 1:06:42I think.
- 1:06:43And yeah, congrats on it.
- 1:06:44Yeah.
- 1:06:45Thank you.
- 1:06:45You bet.
- 1:06:45Thanks for being on the show.
- 1:06:46This has been another episode of Talk Python To Me.
- 1:06:49Our guest on this episode was Joseph Mancusio.
- 1:06:53And it's been brought to you by Linode and Datadog.
- 1:06:55Linode is your go-to hosting for whatever you're building with Python.
- 1:06:59Get four months free at talkpython.fm/Linode.
- 1:07:02That's L-I-N-O-D-E.
- 1:07:04Datadog gives you visibility into the whole system running your code.
- 1:07:08Visit talkpython.fm/Datadog and see what you've been missing.
- 1:07:12They'll throw in a free t-shirt.
- 1:07:14Want to level up your Python?
- 1:07:16If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
- 1:07:21Or if you're looking for something more advanced, check out our new async course that digs into
- 1:07:26all the different types of async programming you can do in Python.
- 1:07:29And of course, if you're interested in more than one of these, be sure to check out our
- 1:07:33Everything Bundle.
- 1:07:33It's like a subscription that never expires.
- 1:07:35Be sure to subscribe to the show.
- 1:07:38Open your favorite podcatcher and search for Python.
- 1:07:40We should be right at the top.
- 1:07:41You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:07:46and the direct RSS feed at /rss on talkpython.fm.
- 1:07:50This is your host, Michael Kennedy.
- 1:07:52Thanks so much for listening.
- 1:07:54I really appreciate it.
- 1:07:55Now get out there and write some Python code.
- 1:07:57I'll see you next time.
- 1:08:17Thank you.