Django Chat

Django Deployments - Eric Matthes

Episode Summary

Eric is the author of the new django-simple-deploy package which provides Django deployment in three steps. We discuss the deployment learning cliff, the ideal hosting platform, and maintaining his bestselling book Python Crash Course.

Episode Notes

Support the Show

This podcast does not have any ads or sponsors. To support the show, please consider purchasing a book, signing up for Button, or reading the Django News newsletter.

Episode Transcription

Will Vincent 0:05
Hello, welcome to another episode of Django chat, a podcast on the Django web framework. I'm Will Vincent joined as ever by Carlton Gibson. Hi, Carlton.

Carlton Gibson 0:12
Hello Will.

Will Vincent 0:14
And we're very pleased to welcome back Eric Matthes, who is the author of Python Crash Course, works a lot with Django deployment. And we're gonna talk all about deployment this episode. Welcome, Eric.

Eric Matthes 0:24
Thank you for having me.

Will Vincent 0:25
So, deployment, multiple ways we can get into this, you have recently released an open source package Jenko, simple deploy. So we want to talk a lot about that. We want to talk about deployment in general book driven development. And just catch up on I guess how you've been to the last two years, I think, since we spoke. So yeah, it's been a while catch us up on what you've been doing since? Because you, you were teaching, I think still teaching full time when we spoke, and you've stopped doing that. So you've had time to, to fill with other things.

Eric Matthes 0:56
I have had my time filled with COVID. Yes, exactly. Yeah. To briefly catch up 2019, I left the classroom. Because it turns out, writing a popular book, and teaching means to jobs. So I've basically worked two jobs for five years. And it was getting a little overwhelming. So I left the classroom in 2019. And then took that fall semester off to just decompress and make a long list of projects I wanted to do. And then 20 came about. So I'm here to talk about Django simple deploy and deployment in general. And that really is one of these projects has been kind of lingering in my mind for years. And I'm finally finding time again to dig into these kinds of projects.

Will Vincent 1:46
Yeah, well, we've spoken about this in the context of just how do we make it simple for readers of our books, because you have a great section in your book. And I certainly looked at that when I was doing my books, and we've had back and forth on, is there something we're missing here? Because Heroku is great, but doesn't quite get you where we want to be. So I think we're going to talk about that, right? Like our ideal wish list for deployment. But and maybe we could tee up and maybe Carlton to you since you're working on

Carlton Gibson 2:14
you. Okay, so you mentioned Heroku. So I kind of, I kind of think Heroku is awesome if you fit its use case, but the way I kind of came to think of it over the years was the kind of deployment cul de sac in that you drive in. It's all very nice. And houses are pretty. But you get to the end and you realize that oh, actually, I've got to drive all the way back out to carry on to the next the next section. There's no screw road from that kind of platform. So that that's kind of, you know, my metaphor for for why not? The Heroku stories. How does that how does that sound to you? Okay, well, I just wrote it up in air, and you can smack it over the bleachers.

Eric Matthes 2:49
I have not heard that metaphor before. I think it's brilliant. I like to call the sack. But I have been Yeah, no,

Carlton Gibson 2:56
it's it's a nice cold reset. But the second you your second, you don't quite fit the use case. It's like oh, no, I've got to spin up this extra service. And it's actually dyno and essential and it becomes, it goes. It becomes anything but simple and quite limiting very quickly once you reach that point,

Eric Matthes 3:14
right. So this average deployment is brings us into the weeds right away. I have been curious, I've really enjoyed listening to your podcast over the years. And listening to a podcast for years, you start to get the patterns. And so I don't know if you guys know this, but I've noticed that whenever the word deployment comes up, there's audible groans, and I groan and moan in the kitchen and laugh and I'm sure it happens all over the place. So it's going to ask you guys, what's your thoughts on why? So deployment is critical for a framework like Django and any web framework? So if there's a piece deployment that's involved in almost every project, why is it that we groan and moan every time that word comes up? I'm curious to hear from you guys. Now share your why I laugh when I'm listening.

Will Vincent 4:03
Okay, I'll start I'll start. You making bunny ears at me as like peace sign?

Carlton Gibson 4:09
Well, no, I've got to I got two points, I'll say but you go first. I'll say my

Will Vincent 4:14
Okay. Okay. So I thought, yeah, I thought a lot about this both, you know, at a company deployment, you know, most of the engineers at a company at scale are focused on infrastructure. Basically, it's not the cred part. It's the making it scale making it fast. And then how do you how do you teach that to beginners? I think one of the hard things for Django is that you know, Django is not responsible per se for deployment yet. Because we use it, we think, Oh, it should just have that too. And you know, Heroku is really good. It's designed for Rails. So rails, there's a one click solution. You know, there's, there's several steps to make Heroku work for Django. It's not that complicated, but it's complicated enough that you can mess it up. So I think part of it is that Heroku is not a Django first solution. It's one click for Rails by design. I think the bigger thing though is that local to production is hard. And you have really nice guardrails, and it's a nice clean garden doing Django locally got sequel lite, you don't have to worry about security, everything defaults to it. But then when it's production, it's the Choose Your Own Adventure. And you're just waiting to make a mistake. So there's performance problems, there's security problems. There's also just lots of different ideas about how you deploy it, plus production database, right. So how do I do that? You know, nowadays, you can do a hosted production database, which really simplifies it. But you still probably want something working locally. So does that mean Heroku? Does that mean spinning up your own thing? So I think it's that huge leap from the knowns of Django, local Dev, which is really nice and clean to, you know, you ask the experts, they all tell you something different about how to deploy. So to me, that's, I think, the crux of it. So it's partly Django. I think it's more the local production thing. And then Heroku, as much as I like it, again, could be more optimized for Django, but Carlton Hugo, you've got

Carlton Gibson 6:05
Yeah, well, you hit my you basically hit my points, I think that I'd say the so many options, like one reason that there there isn't a Django solution is that we can't agree. So quite regularly, it comes up to the Django developers mailing list, something like, Oh, can we can we include a solution for n variables, reading n variables into setting files? Because that's better than hard coding? You know, but as soon as that comes in, it's like, hang on, but you know, embargoes and bears aren't actually, you know, best practice necessarily look at the look for j, then you, Bob vulnerability where they were reading environment variables, you know, that there are serious objections to using violent verbs at all. And so then it, you know, and it gets into this massive debate, and it's like, no, this isn't something we can have inside Django, but like the jangling Byron's that lives is a perfectly good third party package, go and use that. And, you know, it would be the same for deployment. You know, there's there's just no consensus at all about how you should get your web app online. So much depends. It depends on you, I we've done it for seven minutes.

Will Vincent 7:13
I think so

Carlton Gibson 7:15
it's so much depends on what what your circumstances that there is no, Django battery included. This is the thing that should live in the core framework solution that fits the 85% case. And then the other bit was, so there's just so many moving parts, you know, you learn to go do the Django tutorial, you learn to build your web application. And then it's like, you go, how do I get it online. And you've got literally like another week full time to work just to get it provisioned. You know, the first time you do it, you've got to learn about bash, got learn about EmberJS, you've got to learn about databases, you've got to learn about our sink, you got to learn about SSH keys, you've got to, you know, just all of it is it's just massive. So there are too many options. Too many options, too many moving parts, there might there might be one or

Will Vincent 8:05
two. I find too that because I you set it up your deployments, processed the pipeline, and then you don't really look at it again. So in doing the books, I'm curious, if you have this, Eric, I sort of do everything from scratch, and I'm, I forget half the things or something's changed. Whereas in a company setting, if you know, if you're a Django expert, you kind of you have it set up and you're good to go, or my existing projects, you know, I have it configured, but when I have to do it from scratch, it's just so many steps and things change. So that's challenging, like, I'm still I can still never remember all the steps, even for Heroku for a production database, you know, I mean, just tossing it up, I got that memorize, but all the little steps. Even I'm just like, you know, I have to refer to my own books. As a reference.

Eric Matthes 8:49
We write books, looking at their own learning, right?

Carlton Gibson 8:51
To check these checklists, you know, like the pilot flying a plane and Robin Danieli prophet is take care, but a pilot, flying a plane uses a checklist, why? Because it's the high stress thing. And you'll forget, if you don't have a choice, it's okay to look it up. It's okay to have a checklist that's that's allowed.

Will Vincent 9:09
But made before you start Eric, my dream, because you also asked this in the notes, like what would be the ideal, I would want something like so there's nothing Netlify bought this company drop, where you can drag and drop a static site, just like physically drag it or push it. And they'll just deploy it. So it's very opinionated. But if there was something for Django, where you could just drag and drop it in has a hosted database has, you know, some degree of caching by default, and then it's kind of had a list of buttons where you could up the ante on security and performance, which ups the complexity, but there was some baseline of like, this won't, you know, debug is off, you know, you're not totally bad. It's not performant but it's not going to get hacked right away. And you could just go from there. That would be ideal to me, but I don't think that is a great business case. Because it's beginners who don't have much money but think it's possible to do a drag and drop because Carlton, I don't think button is not designed for that your your more advanced case?

Carlton Gibson 10:05
No, no. So the button use case is provision a setup on AC two, just a basic setup on EC two with a very with the bits in place, pull your project from GitHub, make sure that's and set up all of that and get that running. So it's it's provision, deploy. And then backup, monitored. redeploy. That would be the the sort of the picture that you're looking at there.

Will Vincent 10:28
Okay, Eric, you you go for half an hour now.

Eric Matthes 10:31
All right. Boy, one of the things I was thinking about, anticipating this conversation was what was my first deployment. And it was probably back in 2010 2012. Ish. I think it was Django 1415. And I had a problem at school where we were keeping track of the learning standards that were we were using for our students. This is a small high school. And I lifted this system we were developing, and we were doing some really innovative work. And I realized that all of our work, all of it was in Word documents. And so we had had a conversation and our staff and had figured out a way to, to, to move forward. And it involves changing the structure of what we'd been building. And I realized we could not do it, we literally could not take that step forward, because everything was in static documents. And I realized really quickly that we needed a database. And you know, there's no real, I don't think there's a real generally user friendly database, like people, you'd have access. And I don't hear much about that anymore. And I realized quickly that if you want a database now, a lot of it is about building a web app, a front end for web is can be oftentimes viewed as a front end for a database. So I've this research learned about Django built a little project that did exactly what we needed. How cool it works on my machine. Alright, I can probably get this ready for other people on my staff to use, like, oh, no, oh, gosh, deployment. And this is before Heroku. And so my solution was to configure a laptop to run with the lid closed, and I got it running on run server and dumped it into a closet. And we all had access to it.

Carlton Gibson 12:24
And it was on the local network.

Eric Matthes 12:27
It was so perfect.

Will Vincent 12:29
Yeah, it's great. Yeah, very safe. Yeah, I

Eric Matthes 12:32
used to run server in small production. So I think of when I think of this, specifically for people who are new to Django or new to deployment, I think a deployment as a cliff. And so if you think people who are just learning Django, you know, it's a little intimidating for a lot of people to get into, because there's so many moving parts. But they they face that, that difficulty. They choose a learning resource, whether it's tutorial or book or whatnot, they build a project, maybe they modify a little bit and see like, Oh, my idea works. And it's all working on your, on your local system. And to really get something out of a web app, you need to share it with other people for for most people. And so you say, Okay, it's going to continue on the same momentum that I've had in in building a web app. And then like, Carlton I think said like, or what have you just said, that he realized, like, it's another week of learning. After that week of learning, I'm still gonna have this thing that I worry about falling apart somehow. And so. Yeah, what do we do about that cliff? I just finished listening to your conversation with Adam, where he talks about book driven development. And I think that's, it's a good phrase, I certainly have experienced that. And so a lot of my motivation for thinking about this has come from helping readers of Python Crash Course deploy the Learning Lab, learning log project that we built in the in the book. That's the most fragile part of the book, because it basically walk people through configuring a project for initial deployment to Heroku. And at that point, my book is really just a recasting of Heroku has documentation for how to do your initial deployment. And I've been thinking about like, Okay, why have I been so dispatched, dissatisfied with that part of the book? And I realized, just think about this last night, that a lot of what I've written is, is teaching people concepts, teaching people how to think about code, how to think about solve problem solving problems with code. When you get to that part of the book, is really not teaching about concepts. It's really a set of instructions. do this, then do this, then do this, then do this. And I think as grateful as I am to Heroku, for what they have offered, I think it's it's absolutely fantastic. If I if Roku was available back when I was doing that education project, I probably would have used it and been very happy with it. And so Heroku has moved this space forward. But they're still at a space where like, those initial steps could all be automated. So I've been wrestling in my mind for years about how to automate that for people.

Will Vincent 15:36
Sounds like you should be the Django evangelists for Heroku.

Eric Matthes 15:39
Yeah, well, I think, you know, can kind of build this where all this this new work has come from. About a year ago, I ended up learning about the Heroku, build pack a little bit more. And I wrote a custom Heroku build pack that lets you set a configuration variable, like automate all it at that variable is set, then Roku would generate a proc file for you would pull in white noise for static files, it would basically inspect your project and do all of the automatable steps that could be made. As well, as you mentioned, it's basically an opinionated initial deployment of Heroku. But that sounds perfect. But that didn't feel good. Because no, no, that is so good, because it sort

Carlton Gibson 16:30
of, but not that sounds great, because 90% of projects are just exactly the same for especially for that first deployment.

Eric Matthes 16:38
Ray, right. It did not feel good, though, because it really did feel like doing croakers work for them. And Dana Greenfeld pi, Danny pointed out, pointed that out when I shared that on Twitter, and I appreciate him and I appreciate people like him calling out when open source work, leans too far into the world of doing a company's work for them. I was okay with it. Because for me, it was an exploration of what could be done. But it did not leave a good feeling behind for me,

Carlton Gibson 17:14
you've got to you've got thoughts on this as well. Well, no, like

Will Vincent 17:18
you're triggering. I mean, I've tried to, I saw, I've stripped out increasingly external things from my books just because of I felt that that I was doing their work for them, and they change constantly. And then people come to me and say, Why doesn't, you know, this other service work? I've wondered, why don't they invest in someone to do this, you know, Stripe, for example. You know, stripe is a great company, I had the official Django stripe tutorial for a long time. And I had a team of, I think it was a half dozen stripe employees, kind of jumping on my back to update it for this. And that was like, calculating, okay, six of you the time it takes, like, that's so much money, like you just do it. You know, like, Why? Why are you outsourcing this? Like, why don't you just take half dozen popular frameworks and do it and I still don't have a good answer for why they do that. Don't just like dedicated an engineer to, you know, once a month look at it, other than maybe they feel? I don't know, they don't want ownership over it. I don't know, it's it's a little mystifying to me. But I've also just stripped as much as I can just for that reason that it feels like I'm doing their work for them. And I don't, you know, presumably they're making enough money. So I don't know. what the issue is, I've asked lead developer advocates I, I wonder, I think they're more focused on like new features, where sometimes, you know, specific to Django. It's not like the top framework or thinking of whatever reason. So that's just a word jumble. I don't know, it's a frustration for me, I don't quite understand why a billion plus dollar company can't devote a little bit of time to just having a tutorial, not just docs for the top, you know, three or four frameworks that use it?

Eric Matthes 19:04
Well, I think I think I have that answer for Heroku. Or a fair understanding of that, that answer. And this is a little plug for going to conferences when it's appropriate to do so. I've gotten to me, I think all the people who've been responsible for Django on Heroku. Over the years, Kenneth writes, back in probably 2013 2015 ish. Casey Feiss, I think was for a while. I had Morley, I think is is a current Heroku person responsible for Django. I haven't met him in person, but I've had conversations with him online. All these people are nice. All these people get the core issue, but I think they're, they're tasked with so many other things that this never rises to priority. And so I think is that that growth issue? So Heroku was founded to make initial deployments easier. They they solve that problem to at large I agree, they got bigger and then their problems became bigger. And so once you get to a certain size, small issues tend to disappear. And unless somebody is, is there long enough to to continually say, Okay, there's been hanging out for a while we need to prioritize that. It doesn't excuse it, but I think it does explain it. And not just Heroku. But a lot of organizations,

Carlton Gibson 20:25
kind of the point you made will about there not being a business case for this kind of niche. Because will, you know, people getting their first Django app online aren't necessarily the biggest spenders.

Will Vincent 20:36
Yeah. And I think they don't have a way to track it, you know, because you would think that opening a funnel would be a good idea, and I'm sure it is, but if they can't track it, they can't reward it. I think also, Jacob Kaplan Moss was at Heroku. Back in the day, and I know around tooling, I mean, Kenneth did a lot like he had I forget the name of it, he had his Django deployment package, which is still referenced in the docs, though it hasn't been updated in five years. You know, he really was making some efforts on that front. But yeah, he, it was it still referenced? It's dead. And it's still there. And but yeah, I don't doubt it's what you said. It's, they're, they're hit with so many other things. And if there isn't a top level business case for it, it's

Eric Matthes 21:21
what Karla but I'm going to say one more thing on this. It's understandable why these kinds of things drop in priority, but it's also a little risky. Because if the other platform solves this problem, it becomes much easier for everybody else to to jump on to that's where business disruption,

Will Vincent 21:36
new upstart comes up on the bottom makes it simpler.

Eric Matthes 21:40
So it's, it's an understandable business decision, but it's also a risky one.

Carlton Gibson 21:45
So okay, cool. You phrased it slightly strangely, Eric, in that you said something like, I found it uncomfortable that I was doing her coursework in the way you use the past tense slightly, though, it sounds as if you've done something else that moves us. That's

Eric Matthes 22:05
all right. Yeah. So ruminating on this over the years, I realized that what didn't feel good about that Heroku build pack solution was that it's grounded in the Heroku world. And so I realized, there's multiple ways to modify a project. So the buildpack solution was to take your project, and as it heads toward the Heroku platform, on Heroku, and modify the project for their deployment. And I realized you can modify on your own end. So I came to the solution of writing a management command that you run this command once. And it modifies a project as needed for the platform. And then, and then you can push your project pre configured for that platform. So I turned into a package and you can pip install it. Basically, you can take a simple project, simple Django project. If it works locally on your system, you do three steps, pip install Django, simple deploy, add simple deploy to install apps. And then you can run the command, Python managed up, py, simple deploy, that dash automate all and it pushes your project to Heroku. And a new browser tab appears and your project is live and deployed.

Will Vincent 23:32
Fantastic. What's the database piece? I mean, I, I've looked at your project, but to describe to someone right, because someone's got SQLite. Locally, you can't use SQLite Heroku. Because it's ephemeral. It'll be nuked every 24 hours or so. So how do you how do you handle that part?

Eric Matthes 23:48
Let's take a step back. Because we've been talking about how Heroku is, is good, but it's not everything. And so one of the things I like about this project is it's not Heroku specific. The goal is to take a simple Django product that works in your system and let you deploy it as simply as possible. And right now, there's three steps and I don't think you can get any shorter than that. So one of my test for is this project worthwhile is does it serve as a as a layer between our local projects and any platform? And so I looked for a second platform to support. And so I consider an app right? I serve on Azure, because I was looking for a platform where you can do the entire deployment process through the command line. Go a comm

Carlton Gibson 24:45
or using App Service, which is like the Manage Okay, so these your app service it's like the Manage runtime it's

Eric Matthes 24:54
gone. Yes. I brand new to Sure. So this was my month of having 20 browser tabs open on my screen. Yeah. Okay.

Will Vincent 25:06
So did you see Carlton's videos with Azhar? Like from a couple years ago, it

Carlton Gibson 25:10
was the opposite. Not that good, you should check him out. But as your his app services like their their Google App Engine or their Heroku, or their it's a sort of managed application environment, the equivalent of that,

Eric Matthes 25:24
right. So, before we get into details about a specific platform, I want to point out there for jinga simple deploy as your support is experimental right now. But I wanted a proof of concept before digging into it further, that this could work for multiple platforms. And so you can also do, you still do pip install, fingers, deploy, add simple deploy to installed apps, and then an alternative deployment command is manage that py, simple deploy. I think it's dash platform ashore, and then automate all and your project that runs modifies your project, and it pushes to Azure, and a New Project tab opens in your your project is live in Azure. And so that's the vision for this project, that if people have a simple project that works in their system, they can deploy it where they want to, in three commands.

Carlton Gibson 26:25
And then if you've got it working on Heroku, in as your then it would easily work on App Engine, or I can't remember what Amazon's one is, because they have too many services for me to remember the names of all of the services, but you know, it would work anywhere, right? I mean, with the right back end?

Eric Matthes 26:38
Well, it's interesting, because one of the things this leads to, I think we come back to this, maybe near the end is like, what's our wish list for existing platforms or new platforms. So somebody out there like, I'm gonna solve this problem and take that their business away from those other providers Heroku and Azure, you can do this entire process through the command line, that there are some providers where you have to go to their site, click in, do a couple of steps through their GUI, and then go back to your your system, every one of these platforms, you have to go to their site to make an account. But once you have an account, to do the deployment, some require clicks, and some can be done entirely through the command line.

Carlton Gibson 27:24
Okay, tests. So

Will Vincent 27:25
you have a nice section on integration tests on the for the package. Just yeah, you know, there's a lot to say there. But you know, tests are important. They're challenging to well do another automated universal.

Eric Matthes 27:40
Can I come back to that, because I think would be viewed as too, to focus on what this looks like for users for a moment. And then come back to the, the developer perspective. So who's this project aimed at? This is aimed at people who are brand new to programming brand new to to web development, they've finally gotten their project, working locally, and they want to push it live. It's aimed at people who may have more experience as a programmer, but haven't delved into deployment is not meant as a replacement for products like cookie cutter that are much more about configuring a more complete complex production level project. And there's a variety of reasons for that. One of the goals for me is to provide something that is reliable and will be maintained. And so I can, I can commit to maintain this project, especially if if it ends up in the next edition of Python Crash Course, I am motivated to exactly my maintenance work becomes easier, because right now Heroku will knows this Heroku is quite likely to change their process at some point, because they have mothballed. The project that they're relying on. It is getting more and more out of date and likely to break. And so once it fully breaks, they're going to have to change something. And so if I don't do Django simple deploy, then I'm going to need to rewrite half of chapter in my book, The moment Heroku decides to change their process. If I write my very revised my book based on Django simple deploy, that acts as a layer between my book and Heroku is process. And, you know, booked your book driven development when we see a pain point as authors, it's an opportunity for a tool. If your tool only supports your readers, then that tool is going to go away as soon as your your book is out of print. And also your readers are gonna have to go find something else to solve that problem as soon as they're out of your book. So I am developing this for my own motivation but also for general use. And so if this idea is good, I think book authors, tutorial authors, video authors. If you're if the focus of your resource is not deployment, then this is a really good tool for just saying like, okay, here, we've built this, this project. Here's three commands, you can throw it online, and now we can focus on whatever aspect of the project we want to

Will Vincent 30:23
Carlton with button. Work with this, can you command line?

Carlton Gibson 30:27
Yeah, I mean, so the idea is, I give you a list of environment variables that you need to find the most basic setup a list of environment variables that you need to use, or settings that you need to populate from the environment. And that would, I need to look at the scripts. But the idea would be, I guess that you edit the settings file to draw, because Iroko gives you your database URL, for instance, that you have to pull from the environment, right. So in principle, that would work in a similar kind of way, the I, what I like about what Eric's talking about is that it's that literally that 123 In your existing Django environment, I think that's really sweet for that first deploy, I think that's, that's a lovely pip install, add to install that. So you've got a Management Command, and then just run it. That's lovely. Yeah,

Eric Matthes 31:27
a good example for how to think about this is what have you mentioned earlier, people working with the polls tutorial. And so they spend a weekend they go through polls, and that works in their system, like, cool, I'm gonna deploy this. And then Oh, another week of learning. People who gets that point in their learning can run these two commands, and then their polls tutorial that was working on their system is now in the live browser tab. It doesn't, it doesn't mean you don't have to learn about deployment, because you do need to understand what changes were made if you're going to support that project on an ongoing basis and build on it. And so what, in my mind, what this really does, is people get to the point of being ready to learn about deployment. And now they have that week of learning. And that week of learning is filled with opportunities to make a mistake. Okay, for Heroku, you need to make a proc file, what if you make a typo in your proc file, all right, your project is not gonna deploy. And we can look at Heroku output and say, like, oh, there's where the mistake was. But most people that Heroku up is a wall of text, and they have no idea where to start to look for that mistake. And so a little typo, can mean days of of, of kind of poking around trying to figure out why your product is not working. And beyond just those, there's hours or days of difficulty, that's that cliff, there are people, every one of those typos that happen. There's somebody who says like, Oh, this is too hard, or I'm too busy, I can't figure this out, and they never come back to it. And so this kind of flips, that learning process around it says run these three commands, now your project is live. And now you can go back and look at okay, what are the changes that were made? If I want to do this, again, on a production level, what will I need to know? And I think that that's it pretty compelling to use a word pedagogical approach?

Will Vincent 33:22
Well, that's in a way what I got my beginners book, I wrote it in part because there was the Rails Tutorial where the first chapter basically was like, install, create something and deploy it, boom, you don't know what's going on. It's all magic. But I wanted to your point, something like that for Django. So in my books, like the first real project you do, which is pretty basic, I forget, I forget what it is. I think it's the pages. It's just like a homepage and about page, but you deploy it. And it's, I even say, like, you know, don't really worry about this, like, this is just the checklist. But I want you to get that feeling of something live, that you can share with people to your point to get that aha moment and then try to iterate and add complexity. Because if you did any thought and I was gonna say to you one thing I was impressed by reading your both your books, the first time in the update is learning log is not a simple Django project, like you go right into it. You've got user accounts, you've got static files, you've, you know, it's not, it could be simpler. I think it's great that it's not I think part of you know, your other one is a statistical one in the PI game one, those feel there's more space to be descriptive, whereas the Django and you cover a ton of information. So I think that's part of, you know, kudos to you for doing that. But if it was a simpler project, I guess it's like, are you focusing on Django, you focus on a deployment because it would make deployment easier if you just had something simpler, but then you're not really learning about Django, which as I know is the point of your book is to say, here's a Python web framework, you can do something interesting with

Eric Matthes 34:53
AI. Okay, clarify what I mean by simple project. If you're using the this for user accounts, default auth packages in Django. I'm considering that fairly simple. If you're doing

Will Vincent 35:08
email, but users are confusing, though, right? Like, I don't even put in users in the first two projects I cover. I think it's, I think you need it. I think it's great to do. But it's another thing. It's like, what's a user? What's a session? How do I log in, even though you tell people, it's it? That's a cliff, you know, for, for newbies?

Eric Matthes 35:29
I don't think my deployment work would be much easier if I had, if I like left users out. Because, right, yeah, the Heroku deployment steps are pretty prescriptive, regardless of what your project looks like proc file may be simpler for you to have static files, but products to look pretty good without any static files.

Will Vincent 35:47
Well, not the collect static thing on Heroku. That's something that that trips things up a lot that it automatically unless you turn it off, runs collect static, that leads to a lot of beginner errors.

Eric Matthes 36:01
Yes, yes. Again, that's another good point where the whole point of this is, everything is done correctly for you. And then you get to go back and look at it, Carlton, you're

Carlton Gibson 36:14
gonna say something didn't know, I was just, you know, I'm just thinking like, you know, the standard, that kind of standard set up, you know, use for the simplest deployment, configure the virtual end, you know, migrate the DB collect static run the, you know, run the whiskey server. That's kind of it right. But to wrap that up nicely, is the challenge. And, you know, yeah, I haven't got anything interesting. So just interesting. getting hard.

Will Vincent 36:45
Can I see you mentioned the the third edition of your book, is there anything else you can tease that you're going to change or update? No, other than deployment?

Eric Matthes 36:57
No, I, I'm not sure when the third edition will come out. Everything in the second edition is up to date. And so we try to, as, as you're well familiar with, try to maximize the lifespan of each edition. But as soon as the new edition comes out, I started note file about what I might need to change or want to change. And so like I played with the Heroku, build pack last year, I'm trying this approach. Now, I think this is gonna work. I think this is a really good project. And I think I'm going to use it and I think we're going to see some people use it for for tutorials. Yeah. If you guys want to talk, I kind of think of this conversation as motivation. Yo, what's our our all collective experience with deployment? Why do we grown? What does this look like for

Will Vincent 37:55
because we're old? Because we're old? Eric? Doesn't matter?

Eric Matthes 37:59
No, I've heard the young people groan about it to my grown is the same now as it was 15 years ago. And we talked about what it's like for learners. And I think that the third aspect of this is, okay, implementation. Is there anything, you're curious about what this looks like, under the hood, because two users, this is really, three commands, three commands, install it, add it to installed apps, run it, and then their project is online. And, and, um, my next piece of work is to clean up the output. And consider the artifacts that are left behind. And I think what I'll probably do is dump some files, some text files, maybe markdown files into a folder in the project. So you know, this runs in the terminal, you get a whole bunch of information about your deployment. And then once you close your terminal, that information is gone. And you can run something like Heroku apps info and see what the current state of your project, but I think I want to create a folder in the project, like deployment notes, and it just summarizes what was done, summarizes how to make your next change, and then maybe links to resources. Because, you know, I don't want to pretend that this is a replacement for learning about deployment. It just does that initial deployment, and then you need to move on and understand the deployment and how to work with it. So you leave enough behind that people can know where to go to learn more, and use it. Because it's also like, Okay, we just change your project. And so that's, that's an interesting step to I

Carlton Gibson 39:48
mean, I just wonder from you talked about it being prepared to pedagogical approach. I wonder Do you would you would you advise people to do something like a git commit before they run it and then they've got a nice git diff that shows them exactly what the changes were that kind of, you

Eric Matthes 40:05
know? It's a great question. So there's actually two ways to use a command. So the three step version is a simplest. If you run it without the automate all flag, then it configures your project, and it leaves it for you to push the project. So, the two assumptions about this project are one, that you have specified requirements, either using requirements at texts, paper, or poetry. And then that you are using Git to try to your project. So if you run, simple deploy, manage py simple deploy, without the automate all flag, then it just configures your projects that is ready to push to Heroku Bezier proc file is a static file settings set to config variable for debug to be false. In the production version, there's a new secret key. And so yeah, after that, you can look at your project and then do the git push command. I did. One of my challenges with this was to answer the question how, what's the minimum number of commands? And so that automate all going back to the idea of like, what people want is an opinionated approach to all those deployment questions. Should debug be false? Or can I leave it true in my first appointment? Okay, I decided for this project, I'll make it false by default, and then show you how you can you can make it true. Because, you know, those of us who have experience with production apps, the idea of debug being true in production is, oh, gosh, why would you even consider that. But for your very first deployment, where you're just understanding the process, being able to say like, okay, it works on my screen, my local system is not working, all I get is a blank error page. If you can turn debug, chew on for a moment, and just see, okay, that's what Heroku sees, you can fix that. And I think there's, I think there's room to let people do that and not give them the impression that that's okay to do sometimes in production. But the opinion is set to false initially, give them a good a good starting point, and go from there,

Carlton Gibson 42:23
it has to be at least safe by default, right? Because for every rep for every person who's in that learning position, where, you know, perhaps turning on debo true, just to see the output, their output, you know, might be a safe thing to do, because it's a learning project, there's be someone else who's literally deploying their business using just the basic three commands and not really thinking about it at all. And whilst it's incumbent upon them to think about it, kind of we know that they won't, so making it safe by default is a good idea.

Will Vincent 42:52
One thing that resonates with me is what we're talking about here, which is the the next step for, for readers or consumers of your of your open source project or your book. I feel like the weakest part of my books is, of course, I would say this because I wrote them. So I think they're okay, but I think the weakest part is where I direct people next, I spend a lot of time trying to think about not just saying up, see you later, you know, here's here's a couple websites, like can I? Is there something pedagogical? Is there something more I can do to guide people? Because it's easy to say, well, you'd go learn about deployment online, or, you know, you know, short of making that resource myself? How do I like make a roadmap, roadmap or curriculum for people? I'm sure you thought about this, too. So that's a way to tee up. deployment, if you are going to create or write a book on deployment or curriculum. What would you say someone should do? Like how do you go about that? Because it's, I don't know of a place that goes step by step in a progressive manner through through all that,

Eric Matthes 43:49
boy, that is hard. I ended up. Okay. One of the the kinds of emails I got most consistently after Python Crash Course started to become popular as what next? So people would write and say thank you for for this book. It really helped me get through the initial learning what now? And yeah, I'd give some quick thoughts. But I ended up writing in the online resources for the book, a section called recommended reading. And it's really, that's a really nice, yeah. Yeah, it's really four or five pages of, okay, you got through the, the base of the pyramid, or the trunk of the tree. And now there's all kinds of directions you can go. And so where do you go with your general Python learning? Where do you go with Django? Where do you go with all the surroundings of of things like Bash and databases and all that? So I don't think there's a simple, quick answer. I think you have to either have a one on one conversation with people and sort out where they need to go or provide a kind of map of where you can go into thing interesting, but I think it's hard to do that in a book, I think you kind of think that you can provide that online. But it's really hard to in a book to say, here's all the directions you can go

Carlton Gibson 45:12
to taking your point for,

Eric Matthes 45:14
sorry, carry on for deployment specifically, for deployment specifically, I don't know that there ever will be a book, because it changes so much. And there's so many options. And so at some point, like Carlton said, Okay, some people are going to use a project like this for for their business. And okay, if you want to start proof of concept with something like Django simple deploy, you can try that. But if you're, if you're building out business critical infrastructure on, say, Django, you have to dig into deployment. And so you have to choose a platform, and then you do need to spend time digging into that platform documentation or, you know, consult or pay somebody who knows it better already. And those are, those are conversations that sometimes people need, rather than just here's the resource, sometimes it's what they really need is like, Okay, how do you think about building a business? On top of what you just learned,

Carlton Gibson 46:12
taking the phrase you use will about, go learn about deployment online, one of the motivations for getting started with button was that actually, if people go and start trying to type about deployment online, was that they get taken into this sort of Tiger pit of Nacho deployment. You know, one upmanship, where it's like, well, you know, we're using this. And, sure, for the big companies, serious engineers, that's important stuff. You talk about deployment cliff, I always think of it as deployment gap. There's the beginners over here, and then a massive gap to the infrastructure engineers all the way over there. And yes, if you try and learn online, it's all it is, is infrastructure engineer stuff, and you can't, it's really hard to find deployment, you know, for for the for your 95% of projects, who don't have a 10,000 concurrent request problem, they've got a 10 concurrent requests. They got, I just needed to serve a few requests, I just need to get my app online, that's really difficult to find resources for, especially if you just start Googling.

Will Vincent 47:16
I think that's right, that if someone's taking the time to write something, it's generally an advanced person who's proud of something they figured out, but it doesn't, it doesn't apply to the 95%. I've often wondered, how do you is there a way to, they probably don't know what it is to, to mimic the load of a high performance site without all the costs, you know, involved? Right? So we say to people well, like, is there a way to teach someone say, Okay, I'm going to make a sandbox, and I'm going to mock, getting slammed with all these requests, you know, either one at a time or all at once? Or that same day, I mean, you know, like, once a day versus like, continuous heavy load, and then have someone go through the steps to fix that, is there a way to do that absent doing it live in a big company, low cost low, there's probably some way to fake that. But locusts

Carlton Gibson 48:05
do is a very good tool. So you can you can define a set of requests that will come? Yeah. And you can, you can say, I want, you know, so 30 requests from 100. You know, what, so many requests per second, so many clients, and I want them to scale up, right? And what's really nice is it gives you it's really difficult to interpret, you know, you have to go slowly and interpret the results, you know, intelligently, and that takes time and looking at it, but you can kind of see where your response time starts to flatten off. And you'd like right, that's, that's actually, you know, it starts you know, you get to 10 and it's going up nicely, and you're like brilliant, and then 15 requests, it starts to tear and then 30 requests. Oh, no, it's basically flatlined. It's like, okay, that that's my, that's my limit. That's as many as I can hit. And if Hacker News hits me, and I get more than that, you know, my site's not really going to perform. There's a really good tool and it's it's you know, use Python you like little Python scripts to to generate this this traffic. So,

Will Vincent 49:01
yeah, 18,000 stars and I just learned about it. So

Carlton Gibson 49:05
it's called locust IO. Locust locust locust.io.

Eric Matthes 49:10
Locusts like the insect. Yeah.

Carlton Gibson 49:11
Yeah. Because it's like a plague of requests that come down and yes, your your website, but it's a very useful tool for you know, you compare it you want to compare different setups and know, you know, how many how many gana con worker processes should I use? Well, yeah, okay, you can spin up the box. And you can check, try hitting it, you know, do I need a if I hit a what's, how many requests can I get? If I have four workers? How many requests Can I hit? If I use pre fork versus threaded? You know, these these options, which are in the gun comfort config open book, like What difference do they make? Well, we'll know because it's very easy to sort of spin one up, send some traffic against it with a particular profile and say, okay, interestingly, the prefork with four workers for this for this size unit is the best option.

Will Vincent 49:55
I would pay for a Django Lucas book

Eric Matthes 50:00
Again, I think that that's a great tutorial, maybe create like small online course, it'd be hard to write a book on that. And I say, write a book on it and maintain it.

Will Vincent 50:11
We're coming up a little bit on time. I know, we haven't dived into this. But I have to kind of ask Eric, like the future of teaching tech, like I think, sometimes, deep thoughts about you and I have made it work to different degrees. But most people, it just doesn't pay to teach technology. And it's, and yet everyone wants to learn this stuff to get jobs. And I wonder if your thinking has changed in the last two years? Around? Is there a solution there, because when I look at I see, it's hard to do anything as to consumers directly to consumers, because they don't have money out of pocket. It's hard to do something without an accreditation, where they get a degree and then you get a cyber degree, and then they can go check the box on a job. So the need is growing, and yet the pathway to like, do it yourself, you have to be very entrepreneurial. I mean, you you wrote the book, but you also you have the website, you have these projects, you've been doing it for a long time. Like there isn't a straight path where someone who knows this stuff who wants to teach can make close to what they would make de jobbing versus writing a book, and then they have to update it. So as I throw that to you is, you know, the need is there. But the pieces to to make it happen still seem to be missing to me,

Eric Matthes 51:27
boy. cue up the big question.

Will Vincent 51:31
Oh, yes, one as a former teacher to Write Right or as a current different classroom teacher?

Eric Matthes 51:36
Yeah. The orange site had a an article yesterday about how we teach code is broke, broken, or something like that? And give Carlton with big things cuff like, oh, gosh, okay, all the all the things we should think about for this. So I think it's important when you're thinking of the question that we'll just posed to look at the history of learning resources for programming. So if you go back to say, the 50s or so when people were first building these big physical computers, electronic computers, there was barely any documentation. I mean, not enough people these days know this, but it used to be like, your company or institution would order a giant, room filling computer, that company would then like come with trucks and install it into your institution. And you would pay people to come and like, facilitate your first use of that machine. And then things got smaller, and people wrote documentation so that now you can just ship a computer and ship a manual and leave it to your users to learn that. And then people started writing books. And those books were written by programmers for other programmers, with no real notion of non programmers reading them. So they're very dry and very technical. And I should say, very dry, some of them had some, some attempts at humor. And then, programmers started writing for the general audience, but they're still fairly dry and fairly non friendly, I should say, non pedagogical, they were. They were not written with a critical mindset of what might go wrong. And what happened, what can people do when something goes wrong? And then you started to have a mix of people with programming background, and more general backgrounds. And so you started to see better programming books. Were the technical foundation was still strong, but there was more thinking about, Okay, what might might it be like for a non programmer to to work through this. And in the past 10 years or so I feel like there's been more more coming out from people who have a pedagogical background, have experience thinking and working with people who are learning and focusing on okay, we need a solid technical foundation for this resource. And we need clear, critical, intentional thinking about how people learn what they already know, what they're learning in this resource, and then where they're going to go next. And it's about connecting that path. So my takeaway from that article yesterday is like how we teach code isn't broken, is just that there's, there's no one way to do it. And so there are some bad ways, there's some really good ways. And the long term thing that we're all aiming for is a wide variety of really good learning approaches and learning resources that are well maintained and, and whatnot. Your question will have, how do you make money offering those those resources and services? That's a that's another question.

Will Vincent 54:50
I think of this because the, the startup I was at is a Quizlet is an education startup, which hopefully for me will go public this year. But that's a rare case of something actually working out in the EdTech space, there's this huge cliff like I saw code Khadem. II just got sold, they were founded around the same time. Treehouse just imploded, you know, there's, I wonder if there's any middle ground between Free Code Camp, which is fantastic. And a structured curriculum that isn't paid by employer or isn't doing all sorts of dark tricks to up, you know, crank the knob on getting people to pay for something and not having a good outcome. It seems like there are people who, you know, know this information, and we'd like to teach it. But there isn't an easy way to just do it.

Eric Matthes 55:42
No, it's a hard problem. And I think people need to approach the problem of how do you create a learning resource that's going to be received well, and used? I think you need to think as as critically and intentionally about that as you would building an engineering project. It's a classic, like, people disappear into their, their computers for a year, build something and then come out with a working product and go, How do I tell people about this? How do I gain users. And so it's the same thing with with resources. I think money is is important to talk about with that, because a lot of these products that have failed or even caused harm, their priority is making money, and money in education or an interesting, interesting pair.

Will Vincent 56:28
Well, the problem is success means people leave you faster, like you can't have a subscription education business, because if you succeed, they leave. And even if you don't succeed, they're gonna leave, you know, so Quizlet, like loses a quarter of its users or you know, less than that. But you know, if you think of a high school product, right, like you're losing a quarter every, every year, it's right. It's not a great business. Anyway, it's one of those.

Eric Matthes 56:54
So you got to think about that. And so what that means is, okay, if you're successful, your users leave, but then they should be telling other people how they learned. And so

Carlton Gibson 57:03
this should be a fresh call every year. No. Right.

Eric Matthes 57:07
And so high schools get that because people just show up. And so for learning resource, your your hope is that people will use your product be successful, leave, and then tell other people about it. I will say something about pricing. You know, I see, beginner friendly pricing, books are so popular, because people can afford them largely. The value that people get out of my books are Will's books are just fantastic.

Will Vincent 57:35
Your book is so you know, is what 500 pages I mean, it's Yeah, off the charts, the value

Eric Matthes 57:41
25 bucks, and they get life changing experience. But I also see people charging $250 For independently produced materials. And so there's, there's, there's a memory of that there's a place for that in niche markets, where you never can have a large audience, a large number of buyers, and there's a place for that in corporate. But when people are aiming materials, varying the individuals and pricing at a multiple $100 That's that's an interesting decision. And so you I think that if you're going into educational materials, you need to think through all those and and come up with an answer that makes sense for yourself for your learner's and, and for the market in the world.

Will Vincent 58:29
Yeah. Well, edX just got sold to, which makes me sad. And it reminds me that back in my younger years, in 2010, I had a chance to meet the founders of both segment and Stripe multiple times. And both of them started off with education products and then pivoted to, respectively the $3 billion acquisition and probably $100 billion IPO. So you know, that the desire was there, but the business model, you know, that can't be the reason why you want to do it. Anyways,

Carlton Gibson 59:01
there's nothing to say after that, you know, perfect.

Will Vincent 59:04
Yeah. So we will have links to all the things mentioned Django, simple. deploy some GitHub, try it out, use it. I think people know about Eric, Eric's book, flashcards, all the rest.

Eric Matthes 59:17
Thank you for taking me one more time. Yeah, please do please have listeners. Yeah, so I don't have anything to promote beyond what was mentioning. But for Django, simple deploy, it's on GitHub. And if you have if you're interested in this project, if you have a simple project of your own and want to just try it, I'd love to know if it works. If you are creating learning resources for Django and the idea of being able to let your your users deploy the project quickly. Please give it a try. And if you have any feedback on how this could be useful to you as a creative learning resources, I'd love to know that because I'm great For my own needs, but he will do well if it serves many people's needs. So if you have any interest in this project, please do reach out.

Will Vincent 1:00:09
I'm going to do that myself once I finished my, my, the last two of my book updates, but that's something I want to do as well as button data. Whenever that's ready. I promised Carlton when it's live live, I will do a tutorial I

Carlton Gibson 1:00:21
just need about three weeks in normality and then we're there.

Will Vincent 1:00:25
Alright, well again, thank you, Eric. We are Jango chat.com Chat Django on Twitter. And we'll see everyone next time. Buh bye.

Carlton Gibson 1:00:33
Join us next time. Bye bye.

Eric Matthes 1:00:34
Thank you. Bye