Latest / Talk Python To Me / #88: Lightweight Django
Transcript
- 0:00Django is a very popular Python web framework.
- 0:02One of the reasons is you have these many building blocks to drop in for large sections of your application.
- 0:07Need a full-on admin editor backend?
- 0:09There's a few lines of code and boom, you have a basic table editor.
- 0:13This appeals to many people.
- 0:15But for those of us, myself included, who appreciate lightweight frameworks where you choose just what's included
- 0:20and piece together our apps from best-of-breed components, can find this a turnoff.
- 0:24This week you'll meet Julie Ellman and Mark Lavin, authors of Lightweight Django,
- 0:29who are here to dispel the myth that Django apps have to be built out of large building blocks.
- 0:33This is Talk Python To Me, episode 88, recorded November 21st, 2016.
- 0:58Anyone can get the job done.
- 1:00It's the execution that matters.
- 1:01I have many interests.
- 1:03Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
- 1:10This is your host, Michael Kennedy.
- 1:12Follow me on Twitter where I'm @mkennedy.
- 1:14Keep up with the show and listen to past episodes at talkpython.fm.
- 1:18And follow the show on Twitter via at Talk Python.
- 1:22This episode has been sponsored by GoCD and PyUp.
- 1:25That's right.
- 1:26PyUp.io has joined the show as a sponsor this week.
- 1:29Thank them both for supporting the show by checking out what they have to offer during their segments.
- 1:33Julia, Mark, welcome to the show.
- 1:36Thanks for having us.
- 1:38Yes, thank you.
- 1:39Yeah, you're welcome.
- 1:40I'm super excited to talk about your book.
- 1:42You guys are doing some cool stuff.
- 1:43I'm really looking forward to talking about this combination of technologies.
- 1:47I mean, we're going to talk about Django.
- 1:49We're also going to talk about Backbone.
- 1:50We're going to talk about WebSockets, Redis, Tornado, all sorts of cool things.
- 1:55And I really like the way that you put them together.
- 1:57So we'll have a good time talking about those.
- 1:59But before we get to that, why don't you tell us your story?
- 2:01Like, how did you get into programming?
- 2:02I think that my love of programming really started when I was pretty young.
- 2:07And I was very fortunate to be able to learn how to use Logo on Apple 2e in about first grade.
- 2:16And just kind of like being able to just play around, right?
- 2:19So having the ability to do that, really started to get into it there.
- 2:25But I ended up going into art.
- 2:27And slowly after graduating from college, realized that I can't really survive on making art.
- 2:33So I decided to go back to this thing that I was really interested in since I was a kid and started doing web design and development,
- 2:42which back then there wasn't really programs for it.
- 2:45So I ended up getting a job at an internal marketing agency at a small company and really learned there on the job.
- 2:52And shortly after that, got a job at Hallmark Cards, where I was an interaction designer.
- 2:59So doing a lot of e-cards, things like that.
- 3:03Oh, cool.
- 3:03So, yeah, yeah.
- 3:05But then I met this guy at South by Southwest Interactive a bajillion years ago.
- 3:12And he was like, so have you heard of Django?
- 3:17And I said, no.
- 3:18And he's like, oh, you live in Kansas City and you live so close to Lawrence, Kansas, and you don't know what Django is?
- 3:26And I said, no.
- 3:27And he's like, you've got to go work at the Lawrence Journal World.
- 3:30I'm sorry.
- 3:30And that person was Simon Willison.
- 3:33Nice.
- 3:35Nice.
- 3:36And he introduced me to a few people.
- 3:37And I ended up working there for about a year and just learned all about Django and contributed to the actual project.
- 3:46And that's when I really started working in Django was then.
- 3:50It's a really cool way to get introduced to it.
- 3:52It's basically go to the birthplace, right?
- 3:54Yeah.
- 3:55Yeah.
- 3:55It was a really, really amazing time for sure.
- 3:59Because that was like 2007?
- 4:012008 when I started working there.
- 4:05So, yeah.
- 4:06Like three years after it had become an official open source project.
- 4:10Right.
- 4:11It was just some kind of internal thing.
- 4:12It was actually recognized as this big project.
- 4:15Yeah.
- 4:15Yep.
- 4:16Yeah.
- 4:16By then.
- 4:17Yeah.
- 4:17Nice.
- 4:17I love Lawrence, Kansas.
- 4:19I went to university there and I enjoyed my time in that town.
- 4:22Oh, I rock chalk Jayhawk.
- 4:24I'm a Jayhawk.
- 4:25Yeah.
- 4:25Right on.
- 4:26Right on.
- 4:26How about you, Mark?
- 4:28How'd you get into programming?
- 4:30My father, programmer, a long time.
- 4:32Maybe he worked at IBM.
- 4:34My older brother always loves programming.
- 4:37So, I resisted being a programmer, being a stubborn little child, wanting to do something
- 4:45on my own.
- 4:46I always kept coming back towards it.
- 4:49I studied math in college and I dreamed about being a professor.
- 4:54I don't know why anyone would dream about being a math professor.
- 4:58But that's what I had.
- 5:00There's a lot of cool stuff about being a math professor.
- 5:03Job opportunities, not necessarily one of them.
- 5:06I guess I just really love like tweed jackets and elbow patches.
- 5:11And that's what I envisioned for my future.
- 5:14And so I continued doing math in graduate school.
- 5:20And there's a lot of programming that comes into doing some applied mathematics.
- 5:26And as much as I resisted, again, I just kept coming back to it.
- 5:30And when I left graduate school, I started looking for what could I do with this math degree that I had.
- 5:38I was in New York City at the time.
- 5:40And I got into finance.
- 5:43I just got sucked right in to doing crazy math on Wall Street.
- 5:51And it was fun and exciting for a time.
- 5:55We were doing some really cool stuff.
- 5:57Over-the-counter derivative pricing.
- 6:00It wasn't as flashy as Michael Lewis sort of draws in his books.
- 6:05But we were, it felt like we were on the cutting edge of financial math to some extent.
- 6:12But there was a little bit of a financial crisis that you may have heard of, I don't know, 2008, 2009.
- 6:19And while my company wasn't really negatively impacted by that, many of our clients were.
- 6:26And it was a really stressful time to be pricing such a volatile market.
- 6:32We were having a lot of questions about our work.
- 6:36A lot of really bad market data that we were sifting through.
- 6:39In that process, a lot of my work was about automating what we were doing.
- 6:44Collecting data.
- 6:45Parsing really messy files.
- 6:49And trying to turn it into a reasonable data we could use.
- 6:53And we were doing weird things in VBA.
- 6:57Visual Basic.
- 6:58Excel.
- 6:59Yeah.
- 7:00How much of the world runs on Excel as the, quote, programming back end?
- 7:04Nothing you'll ever believe.
- 7:06And then we also had applications that were written in C++.
- 7:10And we had nothing in the middle.
- 7:11And I started exploring sort of scripting languages is what I started looking at.
- 7:18I started learning, I started learning, I started learning Perl.
- 7:21And I had a friend from graduate school who was pursuing a PhD.
- 7:26And he said, forget everything you know about Perl and learn Python.
- 7:30And I took his advice and I did.
- 7:33It didn't stick at work.
- 7:35My boss wasn't really interested in change.
- 7:38But it stuck with me.
- 7:40And I kept playing with it for different, both scripting tasks and automating foreign things and solving math problems with it.
- 7:48And when I decided to sort of leave New York with my wife and started pursuing careers outside of finance, I started looking at what else I could do with this sort of hobby.
- 8:01And...
- 8:03What's this Python good for anyway, huh?
- 8:05Yeah, what's this Python good for?
- 8:07And I had all this free time when I just, we just quit.
- 8:11We just left.
- 8:12Came and stayed with my family down in North Carolina, where I'm from.
- 8:16Built myself a website in Django.
- 8:19And I was having a blast.
- 8:22I built a little route tracking thing for running.
- 8:25And yeah, I was still searching for jobs in finance.
- 8:30And then eventually I thought, maybe someone would just pay me to write stuff in Django.
- 8:34And strangely enough, I found a contractor hosting at the Cactus Group.
- 8:40It was like two guys working in an office in Carrboro at the time.
- 8:45And started working with them.
- 8:47Took on one contract.
- 8:49Finished that.
- 8:50Took on another.
- 8:51And eventually got hired full-time with them.
- 8:55And I've been doing full-time Django development with them for almost seven years now.
- 9:00Yeah, that's really cool.
- 9:01I like how you kind of just kept going and looking for that Python opportunity to work in the space you wanted to.
- 9:08And eventually it worked out.
- 9:09That's great.
- 9:10Changed my life.
- 9:10I mean, the advice to forget Perl and learn Python was the best advice someone's ever given me.
- 9:17Now we come to about a year and a half ago.
- 9:20You guys created this book called Lightweight Django.
- 9:23Julia, what's the story with your book?
- 9:25It wasn't at a year and a half ago.
- 9:28No way.
- 9:28Was it?
- 9:30I think it was like two years ago.
- 9:32Mark?
- 9:32Yeah, it was since it got published.
- 9:34Yeah.
- 9:34Yeah, yeah.
- 9:35It's almost two years to the day.
- 9:36Yeah.
- 9:36Sorry.
- 9:37No, don't be sorry.
- 9:39I just was kind of like, no, it couldn't have been that long.
- 9:41It couldn't have been that long.
- 9:43I thought it was like 10 years ago.
- 9:45So, yeah, come up for the idea for the book.
- 9:48So, the thing with Django is that a lot of people look at it and they're like, oh, it's so big and it's like a dinosaur and can't use it because there's too much and I don't need everything that's in there.
- 10:04And, I don't know, I would just talk to Mark about that when I, like, I would hear this and Mark and I were both working at the same place at that time.
- 10:11It's like, I don't know that I agree with this.
- 10:14There's got to be a way that we can show people that they can use Django.
- 10:19And this is also the time of Flask sort of coming on the scene and, you know, people started making all these little Flask apps and then all of a sudden they're like, oh, I probably should start with Django.
- 10:30I shouldn't have done this.
- 10:31Doing all this work.
- 10:33Yeah, I made all these Flask apps and then I probably should use Django.
- 10:38So, yeah, we kind of talked about it and we were speaking at a conference.
- 10:44We were speaking at OSCON and I was like, what do you think about writing a book?
- 10:49I've got way too much time.
- 10:52Let's just see if we can get rid of that.
- 10:56I remember that feeling.
- 10:57She was just whirted out one.
- 11:00Whether you're having coffee or drinks or something, we should write a book.
- 11:04And I think I just said, yeah.
- 11:06And I had no idea what we were going to write.
- 11:09No, you did not.
- 11:10No, you were like, you were like, I don't know.
- 11:13You were smart.
- 11:14You were much smarter.
- 11:16I was like, we could do it.
- 11:17It's fine.
- 11:17We could do it.
- 11:18And you're like, let me think about it.
- 11:19I remember you're like, I got to think about this.
- 11:23So, yeah.
- 11:25And like calling it lightweight was sort of the antithesis of what people refer to Django as.
- 11:31So, like, oh, I don't want to use that.
- 11:33Yeah.
- 11:34Rather than let's plop in Django ORM, let's plop in like an admin backend all these big building blocks.
- 11:42Your book takes the approach of saying, basically, let's see how you can strip this down to a very small core and then build up your own like starter templates and tweak it however you need.
- 11:54Right.
- 11:55And you're also bringing together a lot of interesting technologies that are not just Django.
- 12:00Mark, how do you pick those?
- 12:02Pick some of the ones that we're most familiar with, either from projects that we've built or, you know, professionally or projects that we've built on the side, you know, experimental projects.
- 12:13One that we knew would work together, one that we had some familiarity with and that had some of the same sort of staying power as Django did.
- 12:23You know, Tornado is one that I really like.
- 12:26It's been around for a long time.
- 12:29And it does this one thing really well.
- 12:32And it's not flashy.
- 12:35It's stable and boring, just like I like my technology.
- 12:41Yeah.
- 12:42Tornado plays a really important role.
- 12:43And definitely when we get to the eighth async section or the real time web section of this conversation, it will definitely come back to it.
- 12:53So when you guys wrote the book, who do you have in mind for it?
- 12:58Julia, like who is your ideal student or who should read this book?
- 13:03Definitely an intermediate.
- 13:04I don't know.
- 13:05I've had this conversation with a few folks, like beginner, intermediate, and advanced.
- 13:09It's like, is there really an intermediate?
- 13:11Is there really like, is it black?
- 13:14I don't know.
- 13:14So when it comes to, I think it's more like people who have actually built a Django application and have some sort of familiarity also with JavaScript.
- 13:24So I think that that is part of the audience.
- 13:26The people who are also in, like have this infrastructure, they're already using Django.
- 13:32They already have it as part of the applications and whatever product or platform that you're using.
- 13:37And they're kind of locked in and they're seeing all these newer technologies kind of come out.
- 13:42And they're like looking at them longingly and they just don't understand how to connect them all.
- 13:46And so, you know, I don't know.
- 13:49I think it plays to a couple, quite a few different audiences.
- 13:51Ones that need to be convinced to use Django that maybe haven't used it before, but have programmed in other languages and other web frameworks.
- 13:58Okay.
- 13:58Yeah.
- 13:59I do think it's interesting to see how these pieces fit together.
- 14:02And, you know, Mark, to your point, it's really challenging to choose those.
- 14:05So you're choosing Django, obviously, but you're also choosing Backbone and Redis and some of these other things.
- 14:13And especially in the JavaScript front end space, that's a real topsy-turpsy world, right?
- 14:18And so, you know, by the time you're done with the book, you don't want the framework to be passe, right?
- 14:22I don't know.
- 14:23I think I've had a couple of folks ask me why we chose Backbone.
- 14:27And I think Mark put it very well, which is just kind of one of the, like, boring and stable things that work.
- 14:36And I feel like Backbone is pretty straightforward.
- 14:40There's nothing flashy or fancy about it.
- 14:42So when it comes to those things, I don't know.
- 14:45It's like, what's in fashion right now?
- 14:48It's like, it works.
- 14:49It works, you know?
- 14:50Yeah, you don't want to get caught with bell bottoms in the 80s.
- 14:52Well, yeah.
- 14:53I think it's also a matter of it's so basic, simple, and straightforward.
- 14:59A lot of the concepts in Backbone can then be played out in other front end frameworks that you're, or JavaScript frameworks that you're wanting to use on your applications, right?
- 15:09Like, it's not going to be too dissimilar than something else that you're going to choose, whether it's going to be React, which is the thing.
- 15:16I think at the time of this book, it was Angular, and people are starting to kind of, like, look at Knockout.
- 15:22But I don't even know.
- 15:24I don't really remember.
- 15:26The debate, I think, we had was Angular versus Backbone or Ember.
- 15:31That's right.
- 15:33Yeah.
- 15:33I know Ember is really popular in the Ruby community.
- 15:37It follows a lot of conventions there.
- 15:40I don't see it used quite as much in the Python community.
- 15:43Maybe that's just my own bias showing through.
- 15:46The concern we had with Angular was the steeper learning curve.
- 15:51And we kind of wanted to focus more on how do these pieces work together rather than let's try to teach you Angular and Django at the same time.
- 16:00And I think that's where Backbone kind of won out out of those three.
- 16:04It had a pretty shallow learning curve.
- 16:07And it sort of used the same terminology as Django did on the back end.
- 16:16And they play fairly nicely together, which works well for the book.
- 16:21Yeah.
- 16:21And I think in the end, like you guys said, it's pretty simple.
- 16:24So if you decided you wanted to go use Ember or something shiny new like Aurelia or whatever, just, you know, you could translate it pretty straightforward if you knew that other framework.
- 16:32Well, not only that, but just showing how do they connect, right?
- 16:36Like how do you connect these two things together, which I think is a mystery for a lot of people that have been showing that translation.
- 16:43And then, oh, oh, that's how you do it.
- 16:45Yeah, absolutely.
- 16:46I think that's a lot of the key lessons that are the takeaways from your book are this piece connects to that piece in this way.
- 16:53That piece connects over to this piece in that way.
- 16:56You know what I mean?
- 16:56So you guys are using Python 3 for your book.
- 17:00And that makes me really happy.
- 17:01I love it whenever I see Python 3 stuff being used.
- 17:04And I've got some good stories on Python 3 coming up.
- 17:07But was that a – how much did you guys think about that or how much just go, yeah, Python 3?
- 17:12Two years ago, it was a different time than it is now.
- 17:15I think at first we sort of thought, oh, we'll do dual code base.
- 17:19We'll do 2 and 3 and just see how that goes.
- 17:24You know, we've written a lot of reusable components that support both and familiar with doing those.
- 17:30But as we started working through that, there's a lot of explaining, oh, well, why do we need this?
- 17:37Why do we have that?
- 17:38And it got a little clunky.
- 17:40We spent a lot of time explaining the differences between Python 2 and Python 3.
- 17:45instead of the message that we wanted to give, which is, you know, how do you use Django with Backbone?
- 17:52Or how do you do WebSockets with Django?
- 17:55How do you build a single file application with Django?
- 17:58That's what we wanted to teach people.
- 18:00And we were getting caught up teaching people the difference between 2 and 3.
- 18:04So in the end, we abandoned Python 2.
- 18:06I think that's for the best.
- 18:08People shouldn't be building new applications from Python 2.
- 18:11Hopefully they're not.
- 18:12We feel strongly about that direction.
- 18:15We also had a lot of support from another O'Reilly author, Harry Percival, who had just published a book that was Python 3 only.
- 18:23And he felt very strongly about that same direction.
- 18:26So we have received some criticism for making that choice.
- 18:30I think someone called our use of Python 3 academic at one point.
- 18:34But even two years ago, we were building applications with Python 3 here professionally for our clients.
- 18:41So I mean, that's definitely the way to go.
- 18:44We've had a disservice to write a book even two years ago based on Python 2.
- 18:49To add to it as well, it's sort of like trying to push the community forward.
- 18:55A little nudge, right?
- 18:57Yeah.
- 18:58If we only write it in 3, that's it.
- 19:00It's like you just got to learn it and got to keep moving forward.
- 19:05And I think sort of like aiding this Python 2 usage doesn't help towards moving everyone towards 3.
- 19:14Yeah, I think all of us that are doing stuff in public, if we can take these small steps, they add up to make a big difference.
- 19:22In aggregate, you know, one of the things that made a big difference in the Python 3 usage measured on PyPI relative to like the year previously or whatever was actually to do with Django.
- 19:37And they switched the default language of their documentation and their tutorials to Python 3.
- 19:43And that actually made like a pretty measurable difference in the amount of Python 3 usage, like as seen from PyPI downloads.
- 19:52So let's talk about the first part, Julia.
- 19:55So one of the things you guys start with is the world's smallest Django application.
- 20:00What's the story of this?
- 20:01So it's sort of like bashing that concept of this is following the instructions of how you actually build an application, like doing the polls tutorial application.
- 20:14And this is the way you have to do every Django app.
- 20:18And a lot of what that chapter is, is saying, nope, you don't.
- 20:23You can actually just have one file to do it all.
- 20:27So when we're trying to think of the progression of the chapters, that was something that kind of starting with, like, I really like how you were saying that you got the concept how the chapters build off of each other.
- 20:43So we start with the tiniest little thing.
- 20:45How much of that is like a reaction to Flask coming along saying, here's our one file.
- 20:51That is the web app.
- 20:53And you thinking like, wait, Django can do that.
- 20:56It doesn't by default, but it can.
- 20:58Totally.
- 20:59That's totally.
- 21:00Yes, of course.
- 21:02That's right.
- 21:03I think.
- 21:04And it's funny because I've had a lot of people tell me and I'm probably Mark as well kind of come up and be like, after reading just the first chapter, like, I never thought of it that way.
- 21:18Never.
- 21:18Yeah, it's it is interesting.
- 21:20Like, you know, the starter projects there and, you know, like pyramid has it scaffolding.
- 21:26And the thing that comes out looks really complicated when you're new.
- 21:29Like, there's like, why are there so many files here and all this stuff wired together?
- 21:33But it's easy to see that as required rather than just the conventions this community is following, you know?
- 21:40Yeah.
- 21:41Yeah.
- 21:41Totally.
- 21:42So another thing that you bring up and I thought was really interesting that you covered here were components or parts of this thing called the 12 factor app.
- 21:50What's the 12 factor app?
- 21:5212 factor is pretty growing popularity, you know, way of sort of building and deploying applications, sort of a set of principles around what makes an application easy to deploy and scale in multiple environments.
- 22:11And we didn't want to preach too much, I guess, about that methodology.
- 22:16But you talk about some of the challenges that people face when they are using Django.
- 22:24I think this question of how do I have multiple settings files comes up all the time.
- 22:33And certainly for that sweet spot of our audience of someone who's maybe built something and wants to deploy it, make it real, you know, put it out on the public internet.
- 22:42Then they come with, well, how do I configure this for my local development and for this production environment?
- 22:50And 12 factor is one way to do that way that I think works fairly well.
- 22:56And so that's sort of the direction we try to nudge people in.
- 23:02Yeah, sure.
- 23:02And I thought it was pretty cool.
- 23:04One of the philosophies you were talking about there is to try to have the minimal amount of deviation from like dev to QA to prod.
- 23:13So the thing you're working on is close to the real thing, right?
- 23:17Absolutely.
- 23:18And making those differences obvious, sort of seeing which settings can be changed, which ones can't is part of that.
- 23:29Yeah, absolutely.
- 23:30So the next section that I thought was interesting and worth talking about, it's this part where you kind of speak to stateless web applications.
- 23:38And you say that much of the focus in Django is about building reusable applications that can be installed and configured for like a Django project, but that can get really complicated.
- 23:48And so you talk about breaking your web app into like small composable services.
- 23:54And I think that's a recent trend that people have been leaning towards wanting to do microservice architecture.
- 24:03You can't see my air quotes, but they're there.
- 24:06And so, again, I think that's where people are reaching for other frameworks that they felt accomplished this better.
- 24:12And part of the story that we wanted to tell was this can be done in Django, too.
- 24:17You don't have to throw away your existing Django knowledge to build these types of applications.
- 24:24In fact, Django has a lot of utilities that make it easy to build these types of applications.
- 24:31One of my favorite things about that chapter in particular is I feel like we do a really good deep dive into some of the HTTP caching layers that Django provides, you know, those utilities that Django provides.
- 24:47And I think that's really important for those types of applications at scale.
- 24:53I agree as well.
- 24:54Like, how much do you feel that developers are spending too much time chasing the shiny new thing?
- 25:01I feel like, you know, especially around things like Node.js and the front-end frameworks, it's like, well, that's six months old.
- 25:08We should be doing something different now.
- 25:09You're doing it the wrong way.
- 25:10It's old.
- 25:11It's like, wait a minute.
- 25:12Isn't that too quick?
- 25:13I feel like it's not necessarily because as developers are always trying to strive to be better, faster, performant.
- 25:23And I think that's, we're always trying to look of that optimal utopia of combination of things and combination of technologies.
- 25:31Right.
- 25:31So I think that's a, that's a big part of this.
- 25:34Yeah, I agree.
- 25:35It's a real challenge because it's fun to work on the new shiny stuff.
- 25:38Right.
- 25:39But at the same time, if you build an app that takes a year to build, you don't want to have like three different technologies mixed in because there were seasons, technical seasons.
- 25:50So one of the things you guys did in this stateless web app section was you created like a placeholder image thing for prototyping out the site.
- 25:58You could say, well, I don't really know what image the graphic artist is going to put here, but it's going to be 200 by 300.
- 26:03So give me a 200 by 300 image, which is pretty cool.
- 26:06And use this package called pillow.
- 26:08People love to learn about new packages on the show.
- 26:11Tell people what pillow is.
- 26:12Pillow is the Python imaging library.
- 26:15I mean, it's a work of, well, now it's really assumed the old pill module.
- 26:22So it's really, I think, the gold standard for Python image manipulation.
- 26:29If you need something to either modify or tweak an existing image or something like we're doing, which is generating new images, it's your go-to in Python.
- 26:41This portion of Talk Python To Me is brought to you by GoCD from ThoughtWorks.
- 27:01GoCD is the on-premise, open-source, continuous delivery server.
- 27:06With GoCD's comprehensive pipeline and model, you can model complex workflows for multiple teams with ease.
- 27:13And GoCD's value stream map lets you track changes from commit to deployment at a glance.
- 27:18GoCD's real power is in the visibility it provides over your end-to-end workflow.
- 27:23You get complete control of and visibility into your deployments across multiple teams.
- 27:28Say goodbye to release day panic and hello to consistent, predictable deliveries.
- 27:33Commercial support and enterprise add-ons, including disaster recovery, are available.
- 27:38To learn more about GoCD, visit talkpython.fm/gocd for a free download.
- 27:44That's talkpython.fm/gocd.
- 27:47Check them out.
- 27:48It helps support the show.
- 27:56Julie, the next thing that you guys did was you said one of the popular trends is to use something to generate like a static site.
- 28:04So maybe it's data-driven, but the thing you actually want to deploy to the server is static because it's easy to scale, cheap to run, and things like that.
- 28:12And so you showed how Django can actually be used to build static sites, right?
- 28:16Static site generators is something that in my current role, I pretty much that is the thing that we use a lot in prototyping.
- 28:26And a lot of what this chapter is about is about doing things like rapid prototyping, right?
- 28:31So you have a client or even just like want to build something quickly or you want a blog and you don't need a database.
- 28:40That's something that a lot of folks go to particular things like other frameworks like Jekyll, Pelican, and a bajillion others that I don't know the names.
- 28:51So there's two ones that come to mind.
- 28:53But there's a way that you can do this with Django.
- 28:56And again, going back to the user that is sort of locked into using Django on whatever platform they're on and then also wants to be able to do something, like I said,
- 29:06that they're using Django.
- 29:09So it's like showing how you can actually do that with technology.
- 29:13Yeah, that's neat.
- 29:14And some of the stuff that you covered in there, I think when people are new to web development, they don't really know about it or they don't pay attention to it until it becomes challenging, let's say.
- 29:25And you were showing how you can do sort of bundling, minification, cache busting, all that kind of stuff with Django, right?
- 29:33That was cool.
- 29:34Yeah, and asset management too, right?
- 29:37Which is a huge thing.
- 29:38Something I've been thinking a lot about lately is asset management in general and how it plays across all these different frameworks, right?
- 29:46And all these different things like how do we compress files?
- 29:49How do we take things that need to be compiled from one thing to another or copied over?
- 29:56And I mean, that's something that just showing someone how to do that in general, I think, has a huge value.
- 30:02So in this particular chapter, being able to show not only how to build something in Django like a static site generator, but also like asset management, which, you know, Django's always been something that I just love because you have so much freedom.
- 30:16I feel like there's not a lot of rules around it, which is another theme of this book, right?
- 30:22Like this underlying theme.
- 30:24There are no rules.
- 30:25Break it apart.
- 30:26Smash it.
- 30:26Just use one file.
- 30:28Like create a static site generator.
- 30:30Whatever.
- 30:30Yeah.
- 30:31Do what works for you, right?
- 30:32Exactly.
- 30:33Exactly.
- 30:33And that's something that, you know, I love about the framework and kind of wanted to show here.
- 30:40So.
- 30:40Yeah.
- 30:41I thought that was, that was really interesting.
- 30:42So then Mark, you started talking about how to build RESTful APIs, because if you're going to have a single page app, a spa, it's going to be pretty boring without some server side communication, right?
- 30:57Absolutely.
- 30:58And I think we have great tooling in the Django community for doing this.
- 31:04And Tom, for see his work relentlessly on Django REST framework, and we're all better for his work and contributions.
- 31:12So, yeah, we wanted to show off sort of how easy and fun and elegant it can be to build, you know, RESTful API in Django.
- 31:23So where do you think people get hung up building like HTTP APIs other than calling maybe it RESTful and it's actually not?
- 31:30They get a fight about whether it's truly RESTful.
- 31:32I mean, like, what do they get hung up in just about like mistakes that you see them making?
- 31:38Well, there's certainly a lot of debates that people like to have.
- 31:42And I certainly like to have my fair share of those base as well, but mostly about wanting good support for validating data that comes in and generating responses to go out.
- 31:56And ideally, being able to accept different formats on both ends, being able to take in JSON and return JSON, being able to take in XML and return XML or YAML or whatever their favorite means of communication is.
- 32:14So I do think people get hung up on trying to make things perfect or fit some vision of what they feel RESTful is.
- 32:23But I think REST framework in this community gets you a good percentage of the way without a lot of work.
- 32:31Yeah, and the fact that there's that nice framework that's really ubiquitous in the Django space makes it – there's a lot of shared knowledge on that, right?
- 32:39That's cool.
- 32:39Yes, and great complementary utilities.
- 32:42It calls itself a framework, and I think it's true because other people are able to build off of it.
- 32:48It's not let's cram everything together, everything that anyone could ever want.
- 32:53It's let's give it extensibility and let other people in the community add things that might be missing from the core.
- 33:01And, yeah, there's just a lot of great activity going around that project.
- 33:07Yeah.
- 33:07Okay.
- 33:08Yeah, that's really cool.
- 33:09One part you guys were – I don't remember what part of it.
- 33:14I think it might have been this section where you were using the forms classes for validation
- 33:20that you would typically use for HTTP get post type forms, and you were applying it for validation.
- 33:26Was that in the RESTful part?
- 33:27We did that in the stateless application.
- 33:31We actually validated the incoming path expressions.
- 33:35Oh, right, right, right, for the sizes of the images and stuff.
- 33:41Yeah, I thought that was cool.
- 33:42Why don't you tell people just real quick about how that's more flexible than, say, just straight HTTP angle bracket form?
- 33:50Well, that's, again, a big theme of the book.
- 33:53And maybe it's an unspoken theme, but it was definitely a big motivator for us is showing using Django,
- 34:01you know, the pieces of Django like it's a collection of libraries rather than a framework.
- 34:07It's something you can kind of take and use as needed.
- 34:11And the forms library is, you know, the forms section of Django is an amazing piece, not just for the HTTP aspect,
- 34:21because, you know, it does help you with sort of rendering HTML forms on the front end.
- 34:27So the biggest piece is about that validation.
- 34:29You know, we've used forms to validate incoming, you know, CSVs, all kinds of crazy stuff.
- 34:36And it's got a really simple API, you know, nice declarative, you know, these are the fields that should be there.
- 34:43And then it takes a dictionary and it says this dictionary is valid or is not valid.
- 34:49And it has methods for, you know, cleaning data that it comes through.
- 34:54Right.
- 34:55And it's not just this value type has to be a parsable integer.
- 34:58It's like this has to be an integer between 1 and 10 or something like that, right?
- 35:03Like lots of nice little rules and whatnot.
- 35:05Absolutely.
- 35:06And as you said, that dictionary, that blob of data doesn't have to come from an HTTP request.
- 35:12They're really decoupled in that way.
- 35:14That dictionary can come from anywhere.
- 35:17And I think it really speaks to, you know, maintainers of the Django project to build something that's as flexible as it is.
- 35:25Yeah, that's excellent.
- 35:26That's very nicely decoupled there.
- 35:27That's cool.
- 35:28So I want to make sure that we spend some time on the last third of your book or last quarter, I guess quarter, but maybe telling people about the middle part.
- 35:38So they know kind of what kind of apps you're building and so on.
- 35:41So, Julia, the idea was you're going to model some kind of like Scrum Kanban board type thing, right?
- 35:47Yeah, and we were trying to come up with an application like what we would use in our day-to-day and basically how that would tie together.
- 35:54But also, like how can we sort of start with like a simple, a super simple part of it, right?
- 36:01And build from that.
- 36:03So that's sort of the concept of why we're going to build like a Kanban board.
- 36:09Yeah, so basically with Backbone, you build a Kanban board and you can edit it through Django and so on.
- 36:17And then you get to this part where you're like, well, it's cool that we have this board, but it would be way cooler if we could edit it together on the web.
- 36:27And so this brings you to a section called Real-Time Django.
- 36:31Like tell us about that.
- 36:32Yeah, Real-Time Django.
- 36:34Yeah, so what is Real-Time Django?
- 36:36That sounds cool.
- 36:37Sounds fun.
- 36:38It can mean anything.
- 36:39Yeah.
- 36:41But Real-Time just covers like such a host of sins.
- 36:44Many sins have been committed in the name of simulating something real-time, right?
- 36:51So this is like I don't want to have to refresh my browser.
- 36:55I want to open a page like Google Docs or something, right?
- 36:57And we can all type and it just, it changes as we all work with it, right?
- 37:01That's the basic theme.
- 37:02Yeah.
- 37:03And like also bringing like it's that whole concept of like you don't think Django can do this, but it can, you know?
- 37:10Yeah, that's really, really excellent.
- 37:12So you guys run down some of the options for Real-Time Communications.
- 37:16You're like, well, we've got WebSockets.
- 37:18We've got server-sent events.
- 37:20We've got WebRTC.
- 37:21There's even like old-school long-pulling.
- 37:23And which one did you end up picking?
- 37:26We ended up going with WebSockets and we spelled this out kind of why.
- 37:31I mean, the server-sent events, you know, are maybe a better map to how we end up using WebSockets themselves.
- 37:40But WebSockets are just better known and better browser-supported.
- 37:45Definitely two years ago, they had much better browser support.
- 37:48Most frameworks that gear towards doing, you know, real-time web typically ship with WebSocket types of support out of the box.
- 37:58And server-sent events are not.
- 38:00It's usually kind of an add-on.
- 38:02So we ended up going with WebSockets.
- 38:04Yeah, certainly two years ago.
- 38:06That makes sense.
- 38:07I think those kind of features have come a long ways in two years, right?
- 38:11It feels like the HTML5 stuff has definitely grown quite a bit from 2013, 2014.
- 38:17Yeah.
- 38:18I mean, it's every day.
- 38:20People would just keep pushing and pushing and doing crazier things.
- 38:25And it's cool to see those technologies have definitely matured to where two or three years ago, something, you'd say, well, maybe this could be an add-on.
- 38:34It's probably not required for your app to really be functional.
- 38:38And now I think, you know, people are really gearing towards more apps where it's like a core piece of functionality that absolutely needs to be there and work for the app to be useful.
- 38:48Yeah, I totally agree.
- 38:49And you guys point to a website that I'm a big fan of called caniuse.com.
- 38:54And as you're talking about these features, you're like, oh, check this out on caniuse.com.
- 38:59Why don't you tell people quickly about that if they don't know about it?
- 39:01That's a good resource.
- 39:02Yeah, it's a place where you can see if a particular feature is going to work on various different browsers, but not just the browsers, but the actual version of the browser.
- 39:12So if you're not quite sure if this is going to be available, a lot of what I do now is making sure things work on really, really old browsers for many reasons, many good reasons.
- 39:24So, yeah, I use that all the time.
- 39:26Yeah, you know, the web is always like a compromise at some level, right?
- 39:31Like, oh, there's this new cool thing.
- 39:33Oh, but it's not supported on IE.
- 39:35Or there's this other great thing, but it's not supported on Safari, on mobile.
- 39:39Then you have to decide, like, do I really want to have a degraded experience for these people?
- 39:44Like, and so on.
- 39:46And sometimes the answer might be yes.
- 39:48Like, for example, if you want to use CSS3 2D transforms, the only browser that that doesn't work on, according to caniuse, is Opera Mini.
- 39:55And it might be totally reasonable to go, I don't care.
- 39:58It's just going to look bad on Opera Mini.
- 40:00Yeah, but there's fallbacks that you can actually use.
- 40:03If you want to go forward and try something, there's definitely fallbacks that you can use.
- 40:08So I encourage those that are listening, like, don't feel like you can't move forward with those particular technologies.
- 40:15Right.
- 40:16There's a lot of times some kind of polyfill you can do, huh?
- 40:19Yeah, Modernizer is a big one.
- 40:21Yeah, absolutely.
- 40:22Let me take just a moment and tell you about one of our sponsors that makes this show possible.
- 40:27This portion of Talk Python is brought to you by PyUp.io.
- 40:31Have a website based on a popular framework like Django?
- 40:34You really want to make sure that you're on the latest point release that includes all bug and security fixes.
- 40:39With PyUp.io, you no longer have to search for updates manually, possibly missing an important update for a security vulnerability.
- 40:45When you add one of your GitHub repos to PyUp's online service, the PyUp bot immediately starts searching for requirement files.
- 40:51It will send you one big pull request that updates all your dependencies, and the bot constantly checks for new releases on PyPI.
- 40:58This PR contains all the info you need in one place, and your test will run automatically, telling you if an update broke your code and why.
- 41:05Try it today by visiting PyUp.io.
- 41:08That's P-Y-U-P dot I-O.
- 41:09Accounts are free and come with one private repo.
- 41:12If you need more, plans start at just $4.99 a month.
- 41:15Okay, so you decide WebSockets, and then the real challenge, and I think I wanted to ask you guys about this in a more broader sense, not just the context of your book.
- 41:28But in order to do WebSockets, you have to have these long-term, many, many, many connections back to, you know, if your site's successful, hundreds of thousands of browsers, right?
- 41:40And WSGI and a lot of the Python frameworks, Django, Pyramid, Flask, they're not really built to handle the asynchronous web or these long, long, long-running connections or HTTP2.
- 41:55A lot of this stuff, do you think it's time for, like, a WSGI 2 or some rethink of how web processing is done?
- 42:04Yes and no.
- 42:05I mean, it would be nice to get a refresh of something that is definitely geared more towards long-term connections over HTTP.
- 42:17But I still think that there's a lot of web applications that are still really request-reply based.
- 42:26And that's fine.
- 42:27There's always going to be that need.
- 42:28You don't want to throw sort of everything out in the pursuit of something that has that support.
- 42:35HTTP2 is probably a really good one where, yes, you want something to, yes, you want something to hold the connections open and make use of the multiplexing that they allow.
- 42:49But that doesn't necessarily have to be exposed at the framework level for it to be useful.
- 42:55Right.
- 42:55That's true.
- 42:56Like, for example, Nginx supports that already.
- 42:59Yeah.
- 43:00So maybe if you're using GeniCorn or uWSGI behind Nginx, like, your actual data-driven Python requests might not do HTTP2, but the rest of it could, I guess.
- 43:10Yeah.
- 43:10What's interesting or confusing may be in this HTTP2 world, you know, a lot of the things that we've been doing and some of the things that we've even touched on earlier, concatenating files and minifying them all together,
- 43:25some of that really loses its usefulness.
- 43:29And instead, you want to make those be additional requests.
- 43:33And you potentially want to be able to do browser pushes on your page load and say, you know, here are all the CSS files that are going to come with this page.
- 43:47Here's all the JavaScript files.
- 43:48So we kind of have to unlearn some of the things that we've done and then add new hooks into our frameworks to be able to make use of the new features.
- 43:59Pretty interesting idea.
- 43:59I wonder if Google will start ranking sites higher that follow HTTP2 someday.
- 44:05If that happens, I suspect it'll push people quickly.
- 44:07Like, for example, they recently started ranking SSL encrypted sites higher than non-encrypted ones.
- 44:14Mobile friendly ones for mobile searches higher and so on.
- 44:17Well, they certainly rank or they value, you know, page load time.
- 44:22And to the extent that making good use of HTTP2 can help your page load time, I think you'll see that reflected whether they make an explicit HTTP2, you know, differentiator or not.
- 44:35Yeah, it's still up in the area.
- 44:35So one of the things that you did is you said, well, because this is how I kind of got out of this conversation is like Django and the wsgi servers in general are not super for this long term connection story.
- 44:51So you brought up Tornado.
- 44:52And so tell us about Tornado.
- 44:54Like, what's the use case here?
- 44:56Well, as I said before, I really like Tornado.
- 44:58It came from FriendFeed before they were acquired by Facebook.
- 45:04And it's been kept going ever since.
- 45:08It's a it's a it's a it's own sort of event based network IO for concurrent, you know, highly concurrent web applications.
- 45:17And it has a small web framework that comes with it where you're basically talking directly with the socket.
- 45:24A little bit different than how you write a whiskey application.
- 45:29You know, a lot closer to the raw TCP connection.
- 45:33And so part of it was sort of love of Tornado.
- 45:37It does great things.
- 45:39It supported Python 3 for a while.
- 45:41And again, that really goes with sort of our message of pushing Python 3 forward.
- 45:46What we wanted to capture was, OK, Tornado is awesome.
- 45:50You want to use Tornado.
- 45:52You already know Django.
- 45:53How can you make them play nicely together?
- 45:56And I think that's the most important aspect of those chapters is let Tornado do what Tornado does well and let Django do what Django does well and learn how to make them work together.
- 46:10Right.
- 46:10Absolutely.
- 46:11So you can focus the WebSocket processing on a small Tornado site and then do the rest basically through Django.
- 46:20Right.
- 46:21And the trick is how to make them talk together because it's pretty easy to set up a WebSocket system.
- 46:26So you can say, well, here's all the listeners on this channel.
- 46:28I made some change broadcast out a message to everybody.
- 46:32This thing changed.
- 46:33And maybe it's not a message, but a JSON document that like tells backbone to update the UI in this way or that.
- 46:39Right.
- 46:40But then they could also go to the website and like add a new card to the Kanban board.
- 46:45And you want them to see that.
- 46:47Everybody else.
- 46:49And you want to do that through WebSockets.
- 46:50So tell us quickly sort of what's the connection there.
- 46:54How do you pull that off?
- 46:55Essentially the choice that we made was to expose.
- 47:00So Django server already had a REST API.
- 47:03That's what the previous chapters were all about.
- 47:05And that's what the browser is primarily talking to, you know, adding new items to the board and moving them around.
- 47:12And then along with the WebSocket, you know, the Tornado server has its own sort of small.
- 47:19I don't really want to call it RESTful because it's not very RESTful.
- 47:24But another HTTP endpoint where it can accept changes that come over.
- 47:29So essentially the browser makes a request to the REST API on the Django server.
- 47:36And that change gets propagated over by making another HTTP request over to the Tornado server.
- 47:42And then that gets broadcast out to any of the connected WebSocket clients that might be interested.
- 47:50Okay, cool.
- 47:50So the flow goes something like the JavaScript client talks to Django via REST.
- 47:55Then the Django server tells the Tornado server via an API that this thing has happened.
- 48:01And then Tornado pushes that back down to everybody except for maybe the person who made the change via WebSockets.
- 48:08Is that right?
- 48:08Yeah.
- 48:09And it's kind of a server.
- 48:11That's pretty awesome.
- 48:13One thing that you mentioned there that I hadn't played with or really thought about is Redis Message Broker.
- 48:20Sure.
- 48:20Because so far the stuff we talked about would work well if like Tornado, the process is managing all the connections.
- 48:29But what if you have like scale out to where you've got like 10 Tornado web front ends or WebSocket front ends, whatever you call it.
- 48:36How do you get that to work?
- 48:39So maybe tell everyone how you were working that out.
- 48:42This is one of the things that I kind of love and hate about this section.
- 48:46I think I would probably rewrite it.
- 48:49We chose Redis because it's simple and it sort of gets the job done.
- 48:54But I would have really loved to use Rabbit if I didn't feel like it would have added a ton of complexity here to sort of talk about AMQP and all those things.
- 49:07So we owned Redis.
- 49:08Basically Redis is the inter-process communication protocol between the Tornado instances.
- 49:15So Django doesn't know anything about Redis and doesn't publish to it directly.
- 49:19Redis is just the intermediary between if you're running multiple Tornado processes.
- 49:27And it's got great PubSub support and it's broadcast only, but that works for our example.
- 49:35So it's definitely sort of the familiar pragmatic approach to doing a simple broadcast example.
- 49:44It seems like a good choice.
- 49:46I mean, you don't want to spend a whole other chapter on like message brokers and whatnot, right?
- 49:50Yeah.
- 49:51Yeah.
- 49:52I mean, we wanted to make it so that it could scale beyond a single process because it's a big pet peeve of mine when I sort of see this sort of toy example.
- 50:02I say, look how easy it is.
- 50:04And it's like, well, it's easy because it doesn't scale like beyond a single process and it has no fault tolerance or high availability possibilities at all.
- 50:14And it's really disingenuous to say, oh, this is, oh, look how easy it is.
- 50:19Well, it's easy when you cut out all those things that people care about in your applications.
- 50:25Yeah, that's a good point.
- 50:26And for WebSockets, it's more important to have some kind of like fault tolerance, right?
- 50:30Because people are constantly connected.
- 50:33It's not just an instantaneous request and they have their page.
- 50:35They're like connected and waiting.
- 50:37But yeah, Redis is easy to get up and running with.
- 50:41People are pretty familiar with it.
- 50:43A lot of people use it for caching as well.
- 50:45And it's nice to kind of have technologies that can do a role when you aren't pushing the boundaries of scale on it that you can make use of Redis in other ways once you have it.
- 50:59It's really interesting.
- 51:00I didn't think about that use.
- 51:01That's great.
- 51:01So I think that's about all the time we have to talk about the book.
- 51:04But I found it really interesting.
- 51:06I like the take on the lightweight aspect.
- 51:10I like the take, Julie, like you said, like, but you can do that with Django.
- 51:13So here, I'll show you.
- 51:15Nice work.
- 51:15Thank you.
- 51:16Yeah, you bet.
- 51:17So you said at the beginning how you got started, you know, like, hey, let's write a book.
- 51:22What kind of advice do you have for others who are thinking about writing a technical book?
- 51:26One of the mistakes I feel like I made was assuming like, oh, yeah, I can write a chapter like that quickly.
- 51:34You know, I could do that like so quickly and one a week.
- 51:37It's going to be what?
- 51:37Like, well, you split it up.
- 51:38That's like a month.
- 51:39We're done.
- 51:39I think I think we had gotten like maybe Mark.
- 51:43It was like two chapters done.
- 51:45And we were like, oh, we've got this.
- 51:48Like, this is no big deal.
- 51:49And that was a mistake.
- 51:52So my advice would be to write 50% of the book before you even pitch it.
- 52:00Like, get it.
- 52:01I mean it.
- 52:01Like, just write it.
- 52:04Like, and at least get a really healthy outline down because you think you know, but you don't.
- 52:11Yeah.
- 52:11When it comes down to editing, especially when it comes to a technical book, because you're not just writing content about like and teaching content.
- 52:22And Michael, I think you understand this for like what you do every day.
- 52:26You know, it's not just about that.
- 52:27It's also about refinement and testing and verifying and seeing how can I make this better?
- 52:34It's like this mega, mega project.
- 52:37So.
- 52:37Yeah, for sure.
- 52:38And if you are like try to make a jump that's too big, you're going to lose people.
- 52:42Right.
- 52:42And so you've got to make sure that you can continually carry them along.
- 52:46And it's a big challenge.
- 52:47Or if you're too academic in your use of Python, which I love that Mark brought that up because we weren't sure if that was a bad.
- 52:54I mean, I think they gave us like one star for that.
- 52:57We're like, I'm actually pretty proud of that.
- 52:59I think that's actually kind of cool.
- 53:02Throw me in with Stanford at MIT.
- 53:03I'll take that.
- 53:04That's awesome.
- 53:06Two questions I always ask my guests on the other way out the door.
- 53:11So, Julie, I'll go with you first.
- 53:13What is your favorite PI PI package?
- 53:16We have over 90,000 now.
- 53:17And I'm sure there's some that you use that are great.
- 53:20Well, I really enjoy keeping my things neat and tidy, especially when it comes to using Git.
- 53:25And while branches are cheap, I still like removing them when I'm not using them anymore.
- 53:30So I really like this little package called GitSweep, which verifies what's been merged in and what hasn't and cleans them up.
- 53:36Oh, nice.
- 53:36So if you do like a pull request and that the request is accepted, the GitSweep will automatically delete the branch, something like that?
- 53:43Yeah, yeah.
- 53:44So you can just keep everything nice and tidy, hence the name GitSweep.
- 53:49Okay, that's awesome.
- 53:51And then, of course, PyLadies, which has a very dear place in my heart.
- 53:55Nice.
- 53:56What is the PyLadies package?
- 53:57I know what PyLadies, the organization, is.
- 53:59So it's actually the kit.
- 54:00So let's say you want to start a PyLadies in your local area.
- 54:04Then you can just pip install PyLadies.
- 54:07And then you can get a whole information package of how you can get started.
- 54:10And I believe that the package is, I can't remember the name.
- 54:13Sphinx.
- 54:14It's built off of Sphinx.
- 54:15So I don't know if it's based off of Read the Docs or it's just straight up Sphinx.
- 54:19I can't remember.
- 54:20Sure.
- 54:20But yeah, it's just a nice little thing.
- 54:24Linroot made it because she's amazing.
- 54:26Yeah, that's awesome.
- 54:27Yeah, I had her on the show.
- 54:28She's great.
- 54:29Mark, how about you?
- 54:30My favorite package is Django.
- 54:31Obviously, it's my livelihood.
- 54:35And I'm thankful to have found it.
- 54:39And beyond that, I mean, I like a lot of sort of linting tools.
- 54:43I'm really grateful for Flake 8 and the suite of tools around PyCode style and PyFlakes.
- 54:52I make a lot of typos.
- 54:53And so it helps me catch when I misspelled a variable in one place to say, hey, you're
- 55:01trying to use a variable that's never been used.
- 55:04Or, hey, this variable that you thought you were using isn't being used.
- 55:08You just spelled it wrong.
- 55:08It helps me find a dead code or code that is imported and not used.
- 55:14So I really always install Flake 8.
- 55:17Yeah, that's great advice.
- 55:19All right.
- 55:20So the other question I always ask is when you write Python code, what editor do you use?
- 55:25Julia?
- 55:26I don't have really a favorite.
- 55:28I think it's whatever I need to use at the time, depending on what space I'm in.
- 55:32Because I use Sublime, but I've also used Atom.
- 55:35And I use Vim sometimes.
- 55:37I just kind of like don't want to leave command line.
- 55:40But it's not like, I don't know, I just don't really have a favorite.
- 55:42It's whatever works at the time.
- 55:44Whatever I'm trying to do.
- 55:45Be flexible.
- 55:46Awesome.
- 55:46Mark?
- 55:47As pretentious as it sounds, I really like them.
- 55:50I switched a couple years ago.
- 55:53And it's been really nice.
- 55:55It really helps me focus to just sort of see one file open at a time.
- 56:01I have to be very deliberate about moving out of that file, moving to another one.
- 56:06And whereas I found myself, when I switched from Sublime, and I just found myself kind of having
- 56:13a thousand files open in a billion tabs and clicking around everywhere to try to find where I was going.
- 56:19And just Vim has really helped me focus on one task at a time.
- 56:25Oh, yeah.
- 56:25That's a really cool advantage.
- 56:26All right.
- 56:27You guys, final call to action.
- 56:29What do people do to get started your book or take advantage of this whole idea that you're promoting as lightweight Django?
- 56:34Well, if you haven't checked out the book, it's available for purchase on O'Reilly's website.
- 56:39You can get e-book or a beautiful dead tree version with a hummingbird from the front.
- 56:46Nice.
- 56:46And I'll be sure to put the link in the show notes so people can check it out.
- 56:49We have our code examples up on GitHub, which you can see without purchasing the book, though.
- 56:55They maybe won't have a lot of context around them.
- 56:58Additionally, I recorded a webcast with O'Reilly about intermediate topics in Django.
- 57:05So if you sort of fit that audience of, you know, I've done a little bit of Django and I'm not sure where to go beyond the polls sort of tutorial, you can check that out.
- 57:17I cover using Django along with Celery for background task processing.
- 57:22And I talk about using Playgate to keep your Django code clean and up to date.
- 57:27All right.
- 57:28Awesome.
- 57:28Julia, Mark, thank you for being on the show.
- 57:31This is a really interesting take on Django, and I enjoyed talking about it with you.
- 57:35It's been great talking to you.
- 57:36Thank you for having me.
- 57:37This has been another episode of Talk Python To Me.
- 57:41Today's guests have been Julie Elman and Mark Levin.
- 57:44And this episode has been sponsored by GoCD and PyUp.
- 57:47Thank you both for supporting the show.
- 57:49GoCD is the on-premise, open-source, continuous delivery server.
- 57:54Want to improve your deployment workflow but keep your code and builds in-house?
- 57:58Check out GoCD at talkpython.fm/gocd and take control over your process.
- 58:05Are there bugs or vulnerabilities hiding in your app's dependencies or even in their dependencies?
- 58:10Stop guessing and start getting notified by registering your GitHub repo with pyup.io.
- 58:16Are you or a colleague trying to learn Python?
- 58:18Have you tried books and videos that just left you bored by covering topics point by point?
- 58:23Well, check out my online course, Python Jumpstart, by building 10 apps at talkpython.fm/course
- 58:29to experience a more engaging way to learn Python.
- 58:32And if you're looking for something a little more advanced, try my Write Pythonic Code course at talkpython.fm/pythonic.
- 58:39You can find the links from this episode at talkpython.fm/88.
- 58:44That's right, I've added a new short link.
- 58:47So anytime you want to get to a particular episode, it's always talkpython.fm/show number.
- 58:52There's all sorts of cool stuff on the show pages, so be sure to check them out.
- 58:55Be sure to subscribe to the show.
- 58:57Open your favorite podcatcher and search for Python.
- 58:59We should be right at the top.
- 59:01You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm.
- 59:10Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
- 59:15Corey just recently started selling his tracks on iTunes, so I recommend you check it out at talkpython.fm/music.
- 59:22You can browse his tracks he has for sale on iTunes and listen to the full-length version of the theme song.
- 59:27This is your host, Michael Kennedy.
- 59:29Thanks so much for listening.
- 59:31I really appreciate it.
- 59:32Smix, let's get out of here.