Django Chat

Django Versions

Episode Summary

A discussion of Django versions including the recent 2.2 release, LTS's, and what's in store for Django 3.0 and onwards.

Episode Notes


Episode Transcription

Will Vincent  0:06  

Hello, and welcome to another episode of Django chat. Today we're going to talk about versioning in Django 2.2 just came out, which is a long term support release. So we're gonna dive into what that means and how to understand versions in Django. Hi, Carlton, how you doing? I will do very well. So you are the Django fellow you are as much as anyone responsible for the releases of Django, right?


Carlton Gibson  0:27  

Yes. Yes, it falls upon me. So one of the key points about the pilot program is that we handle the releases. And so we do those monthly normally. And yeah,


Will Vincent  0:36  

that that's a keyboard. Can you talk just briefly about the chord, the levels of involvement, right, the core Django and developers, people who can do commits and how that all kind of comes together for a major release like 2.2.


Carlton Gibson  0:49  

Okay, well, so most of the commits now are done by the fellows which, up until recently was Tim Graham. He just sat down and now it's myself and malleus, who do the with the current China fellows And then you mean approving approving what gets in? Well, yeah. But also anybody can help approve. So you know, if you if you want to come and review a pull request, then please do. There's a patch review checklist. And that would be amazing event. If you want to come in, we'll talk in another episode about contributing more. But then once all the commits are in, Maris and I are responsible for rolling the release and putting apple pie and making it available to you


Will Vincent  1:28  

got it. Got it. So let's talk about so 2.2. This comes after 2.1 and 3.0 is coming out later this year in December, can you talk a little bit about what is you know, what makes something a major release and then we can talk about you know, why the switch to starting with 3.0 and 3.1 and all the rest of it.


Carlton Gibson  1:48  

Okay, so each version of Django has a main a period of nine months where it's in mainstream support. And so 2.2 is now the current version and we've just finished with 2.1 and before that two point And then before that one point 11. And the major versions between one point something two point something three point something is there'll be a long term support for each major version and that.


So it was well beyond


the initial nine months where version gets met, is in mainstream support, it also gets another nine months of extended support where it gets security fixes and any data loss bugs get back ported. The long term support release gets a whole like at a whole nother two years, I think.


Will Vincent  2:30  

Right? Well, within that So, so 2.1, which we're just coming off of so 2.1 came out. And then there's also there'll be pure AI CLI 2.1 point 1.2. These are the smaller, what's the technical term? Those are the generally security.


Carlton Gibson  2:47  

Okay, so when the new version comes out for the first nine months, it's in mainstream support, and it will basically get a release every month. I mean, unless there are no changes, but there will be changes. And at that point, it gets bug fixes Any bug fixes that come in within that last nine months get get them included in the current version, whichever is the current version. That's what mainstream support means.


Will Vincent  3:11  

Right? So it looks so April, April 2.2, point zero and then probably in May, there'll be 2.2. point one, which will be the bug fixes that have come up. Yes. And that process will continue for the nine months, or nine months.


Carlton Gibson  3:25  

Yeah. And then once that version reaches the end of maintenance, boy, it goes into extended support, and that after that there will only be released if there's a security issue. Or if there's a data loss mark.


Will Vincent  3:41  

And this gets into long term support releases, right?


Carlton Gibson  3:43  

Yeah, right. So the long term support release is last for the whole, like, basically for releases. It's it's the whole of the 2.0 cycle. 2.2 will be there until 4.0, basically,


Will Vincent  3:57  

right in the same way that 111 was the previous Long Term support release. So 111 has continued to be updated for 2.0 2.1.


Carlton Gibson  4:04  

Yeah, I think that's another nine months to go even now.


Will Vincent  4:07  

Yeah. Right. So once Yeah.


Carlton Gibson  4:10  

So the key point is that you the long term support, they're not getting bug fixes. They're only getting what's there outside of mentoring support, they're just like all the other versions, they get nine months of the latest bug fixes game that getting put in, but then they'll only get a back port of another fix if it's a data loss bug or security bug. And they give a bit more stability. If you're, if you're running an application where you can't guarantee that you'll be able to keep up with the latest, the latest version, then they give you the stability and security to know that for the whole life of that that major series, your version will be supported. 2.2 will be current all the way through till the next long term support at the end of the 3.0 series, or the three point X series. So you can stay on that for two years or three years, which I think a lot of companies do to


Will Vincent  5:00  

Yeah, and yet we've we've discussed this, you know, privately it's worthwhile to stay up to date, not just stay in the long term support release, but to. And so, you know, we've talked about, you know, what were the highlights for this evening for somebody who's sitting there saying, this takes time, I don't have time. Okay. So


Carlton Gibson  5:18  

back in the day, maybe a job updating between Django versions was a serious thing. There were quite a lot of breaking changes. And it was difficult to update these days when we're much more conservative. And this is, this is one of the great things about Django is it being because it's a mature framework? People sometimes think that means it's boring. No, that means it's really exciting. What that means it won't break on you. It won't break on you. So we have really careful about not introducing breaking changes. And if we do, they're well documented in their small and there's a there's a deprecation policy. What does that mean? It means that if we're going to get rid of a future, it won't be good got rid of immediately it will be in the version which So say we introduce a Application now in 2.2, it will be pending deprecation in 2.2. It will be deprecated in 3.0,


Will Vincent  6:08  

and it will only be removed in. Right and and, you know, we'll we're going to link to this in the notes, there is a way to run Python and see these deprecation warnings before it fully breaks. I mean, because this there's a point, you know, there's a lot of people are still on Django 1.5. And so if 2.2 comes out, certainly, I've done this before. You say, Okay, I'll just update to 2.2 and fix everything that's broken. But as you have educated me, that is decidedly not the way to do it. Well, because if you go, you know, 1.6 with flags, and correct things and 1.7 right, this is the recommended way to


Carlton Gibson  6:46  

Yeah, I mean, to get to get all the way. Five, it's you've got to, you've got to dedicate some time, but let's say you're wrong. What point Yeah. You're on a supported version. If you're not on a supported version, we're okay This time, but the general policy is the same, it's just going to take you longer. So from one point 11 run with the deprecation warnings enabled. So appending deprecation warning won't show by default. So you have to run it with this w flag, W, you can either run it with D for deprecations, or all to get all all those and be like shut


Will Vincent  7:19  

run, Python managed up py run server.


Carlton Gibson  7:22  

Yes, instead of running run server, you have to run Python, with the W flag. So WD for deprecations, and then run server. So you have to invoke Python again,


Will Vincent  7:34  

we'll link to that so people can see that but then it will then show the deprecation warnings.


Carlton Gibson  7:39  

And so yeah, version that you're wrong. Run it with the warning flags enabled, then fix those deprecation warnings. Then upgrade not from one point 11 to 2.2. But one point let on


Well, okay, so in theory right


there, you can upgrade from one LTS support to the next LTS support without Having to jump on going all the hoops that's the idea between behind the but


Will Vincent  8:03  

whether or not you can the practically speaking, you're better off to go


Carlton Gibson  8:07  

You better off to go to the next minor version of 2.05


run again with the warning flags enabled fix any warnings 2.1 same again.


Will Vincent  8:17  

Yeah, I think I think these deprecation warning flags are a very underutilized feature.


Carlton Gibson  8:23  

Right. And the key point is if you do this, and this is where Django was so excited, but if you could do this process once every nine months, you can allocate a day or whatever to


running installing the new version,


turning up turning on the flags, making sure it's it's all fixed installing the new versions, grab a coffee, read the release notes, because there are copious release notes,


Will Vincent  8:43  

which will also link to for every version,


Carlton Gibson  8:45  

right and they they give you all the breaking changes and you know, and the upgrade process is actually these days very smooth.


Will Vincent  8:55  

Yeah, it's changed it's it's a lot smoother than it was and and you also you know, you Of course, you have tests in your project, right? So you can


Carlton Gibson  9:02  

run your tests. And if you've got, yeah, if you've got ci, then just


go, you know, even if you haven't got ci, just got unit tested, brilliant, you can create a clone of your virtual environment, you can install the latest version, you can even install Django master from Pip. And then you can run the test suite and see what's breaking. And if things are breaking before release comes out. So we've just finished, we've just released 2.2. But there's, there's an alpha release, there's a beta release, there's a release candidate, if you can install those beforehand and run your test suite and let us know what's breaking, then you we will fix those those breakages before Yeah,


Will Vincent  9:35  

this is really important for the community to Yeah, to do the pre release versions.


Carlton Gibson  9:40  

Yeah, especially if you've got ci there's no reason why not use tox


create an environment that installs the Git the development version or the release candidate version, run your tests, let us know if something broke that wasn't meant.


Will Vincent  9:51  

Yeah, and we're gonna do a whole separate episode on testing and continuous integration and, you know, talks there's a number of other services but to take away You should have this. Yeah, we'll cover we'll cover how you can do it. I mean, this is something I'm spending quite a bit of time in my new book, Django for professionals talking about how to do this, because it's not always well documented. But, you know, if you're thinking about joining a company or a project, and they do not have a continuous integration testing, that's a big, big warning flag. It just is crazy. Once you know a little bit about Django and web frameworks not to be using one


Carlton Gibson  10:24  

or anything like it's not just Django, it's,


it's everything. Yeah, untested code is broken by design is the quote.


Will Vincent  10:32  

Yes. But you know, for the beginner intermediate developers or people who've done solid projects, just were mentioning this for you. Yeah, I mean, you will see it, you will see it and you will see crazy things you in the real world.


Carlton Gibson  10:46  

For me, you've got to test the code somehow. Right. So you can either open up your browser and load up the page and click through manually, in which case every time it comes test it you've got to go through those manual steps, or you can take the time to write a unit test some kind of, you know, beats using


a browser driving


Will Vincent  11:04  

like Selenium or something


Carlton Gibson  11:06  

like Selenium or something like that, or just the unit testing part in pipe your Python code. But if you take that time, then you can run that test that test automatically every time you make a code change, rather than having to do it manually. You've got to test it either ways, you might as well


Will Vincent  11:21  

yeah. And you have to test it yourself on a project once you get beyond a very basic stage. And then when you're on a team, you absolutely have to, you'll just go crazy without the test.


Carlton Gibson  11:31  

And so when you writing code as well, I mean, the people talk about test driven development, you know, some test driving is great. But for me something quite often very, I don't know how to code is going to be the same way. I just


one way of


one way of working out how it's going to behave is to write a unit test. And then you know, I can some you can even put a breakpoint in the unit test and you can say, Ah, this is the state at that point.


Will Vincent  11:54  

Right. I don't think it's helpful. Well, there's a whole bunch of talks on this. I mean, David Hannah Meyer Hanson, I think is the most Public and being against, you know, extreme test driven development. I think the key is whatever works for you. Sometimes I'll do the test first. Probably, generally speaking, I write the test after but immediately after, but it sort of doesn't really matter it. The tricky thing is when you're learning Django is, it's hard to write a test when you have no idea what you're doing. So I think especially, you know, formal test driven development, we write the test first that presupposes you know, where you're going. And so, you know, if someone's a beginner or an intermediate, I would not worry about having trouble doing test driven development, because it's just something that it's more I think it's more of an expert level thing. When you're beginner, intermediate, it's much more appropriate to write the test after you've gotten the code working. I was


Carlton Gibson  12:44  



Will Vincent  12:46  

Yeah, but you'll hear you'll hear different things, but I guess Don't be, don't beat yourself up about it. I mean, I have trouble doing TDD. My brain just doesn't quite work like that. On occasions. As you mentioned, sometimes writing the test will help me think about the problem. But you know, I think people who are Really into test driven development? Talk about it, and people who just do normal tests don't talk about it as much. So there's a little bit of an imbalance there.


Carlton Gibson  13:06  

Yeah, I think so. What would I say? I'd say, even if you're a beginner, use the Django test client, and just write a test for the happy case. But yeah, I hit the view the URL, and it loads up bad programming. Yeah, yeah. But like it loaded, and they gave me 200 response. And in the response was, you know, hello, world, whatever you put in in your HTML page. And what that gives you there is at least a regression test, so you can


run something anytime something broke,


then that won't work anymore.


Will Vincent  13:38  

Yeah, well, and since we're, you know, since we're talking about tests, just, at least for me, I typically will start with, yeah, do I get a 200 response? Do you know check the template? Do I use my using the correct template? Does that you know, if the template has homepage in it, I'll test something that's in the template that should be there. Then you can test the views. You know, you can go through you can test the templates, test the views. You are Test the models it Yeah, it's helpful. Well, I will


Carlton Gibson  14:02  

do a whole thing on it and say you added,


I don't know, a method to your model property to your model that calculates something. We'll just write a test for that. Did it work? Well, there's two ways of checking. Did it work? You could open up the shell and call it by hand. Or you can write a test that does the same thing, right? Yeah,


Will Vincent  14:17  

it's actually a little bit lazier. It's lazier to write the test. Because rather than having to keep manually doing it,


Carlton Gibson  14:22  

yeah, exactly.


Will Vincent  14:24  

Alright, well, let's let's move on slightly, though. We Oh, yes. So Django 3.0. So that's coming out. So this year, there's two major releases. 3.0 comes out in December. And maybe I could, if you can talk about, so what's different in 3.0? And then timing, right. I mean, cuz the big news is, it's async. What as we've, as we've discussed, you know, a new release is coming out in in December, either way. And then the question is, you know, how much async does it have, because there'll be 3.1 and 3.8. So


Carlton Gibson  14:55  



right, so the big thing in the Python web framework world is async i o and can we have can we use? bring that into Django for us? So that's on the horizon. And yeah, hopefully some of that will get done this year. And if we can, then that will be in 3.0. But 3.0 is a time time based release, where there is not feature base.


Will Vincent  15:17  

So yeah, the


Carlton Gibson  15:18  

thing is release, there is a release there wasn't released in April, there will be a release in December, there will be one next September, as well, like 3.1, and so on. You know, that's the cycle of releases that we're on. And what's in it is just what's completed at that time. So hopefully, for me, I'd love it if there was async functionality at the view layer, or at least, maybe at the ORM. You know, even it doesn't have to be complete. But if there was some, then that would be great. But we'll see. The key point for me is that 3.0 isn't going to be a breaking change. It's going to be just a continuation of Django that we know and love 2.1 2.2 3.0 it's it could be could have been called 2.3. There's not going to be breaking changes, we're not going to mean that you can't upgrade without serious work is still going to be that rather coffee read the release notes


wrong with the warning, so why not install a new package?


Will Vincent  16:14  

So why not call 2.3? What was I guess? And this speaks to the question of so who decides, right? Who, if you can speak to so who says three? We'll go we're gonna go 3.0. And it's going to be in December because there is a roadmap, but what how does that roadmap get developed?


Carlton Gibson  16:28  

So the idea was that there would be a LTS and long term support release at the end of each major version. And then, and then we would bump the major version for each LTS. So the 2.2 is the last two point x release, and that's the long term support until I guess 3.2. You know, I don't know what the roadmap looks at the end of 3.0. But the release if it goes


Will Vincent  16:55  

up, it goes up to 3.2 is the long term Okay, so,


Carlton Gibson  16:58  

okay, so that was it. really isn't anyone else? Yes. Right. And so 4.0 will just be the release after the next LTS.


Will Vincent  17:06  

Okay, right. And that was the idea was to number it that way. But there's no it but who who's deciding this? Can you just turn the governance of Django? Like, I mean, you read the Django fellow but who who do you know, who do you work for? Who do you answer to?


Carlton Gibson  17:20  

Well, this was I answered, well,


you know, I'm contracted Django Software Foundation, who were the custodians of Django. And you know, they do all the


Will Vincent  17:28  

nonprofit in charge. Exactly.


Carlton Gibson  17:32  

But this the people who govern Django are the people on Django developers. The Django purpose mailing list is the place where Django is governed. And their their historically has been a thing called Django core, which was the people who have contributed, contributed, they've been invited to Django core, but that is in the process of being dissolved and will be dissolved this year. And that will be replaced by governance amongst the the wider community. A lot The Django core members have retired that, you know, they're not really active in Django anymore. And yet that it makes it look as if there's 50 of them. Well, there's not this half a dozen people really that maintain


Will Vincent  18:11  

regularly. And there's also time and efforts to have the that group reflect the community, which is pretty global at this point.


Carlton Gibson  18:19  

Yeah. And, you know, it's a


lot of Americans, a lot of Europeans, a lot of men, and Django is a much more diverse community than that, and it wasn't represented in Django core, which is, is populated by people have given a lot in the past to Django, but a lot of them have moved on and work on acting now. And so there's a feeling that Django core is not representative. So that would be phased out. And then the management of Django will really occur on the mailing list amongst literature, anybody could come join that and anybody can contribute and offer their opinion and, you know, join in the discussion. And then ultimately beyond that, the Django Software Foundation, the board of the Django Software Foundation will have that supervisory role. Yeah, that they would be the court of last appeal. Oh, yes. We'll have you.


Will Vincent  19:06  

Yeah. Well, this is actually we will link to your your talk from Django con us in the fall where, what was the title of that? Again?


Carlton Gibson  19:14  

I need you framework. I need you.


Will Vincent  19:17  

Right. We're one of the one of the points you made. I think you showed the graph of the fact that it's really half a dozen people who do the overwhelming majority of of work, and then there's a very long tail, right? Yeah,


Carlton Gibson  19:29  

yeah. And so it seems


Will Vincent  19:30  

like you know, millions of people use Django, it's, it's this amorphous thing. And yet, it's yourself and a small handful of other people who really make it happen and basically, largely unpaid.


Carlton Gibson  19:41  

Yes, it is. I mean, you're


Will Vincent  19:43  

paid as a fellow.


Carlton Gibson  19:47  

But other than that, it's volunteer work. But, you know, there are a few major contributors that I, you know, that if you quiz them directly, well, it's part of their work, you know,


Will Vincent  19:57  

right. Well, yeah, right. Yeah. Well, because that's the thing of, you know, who, who are these jank? You know, Django core people it is a mix of, of individuals at larger companies. And then quite a lot of consultants actually are individual contractors. Yeah, because


Carlton Gibson  20:11  

people use people using Django and they want it to work well, and they want to work for them and build a business around it.


Will Vincent  20:17  

Right? In some ways, I guess if you're, that's the dichotomy is if you're on a major, say, in a huge company, you have, you're getting paid by your employer to dive in and solve this particular issue that will generate the community whereas if you're a consultant, and you're building half a dozen, a dozen new Django sites, in some ways, you're more apt to be able to try out and use the new features and you know, yeah, but put them in practice more so than a more established site. Yeah. I mean,


Carlton Gibson  20:44  

you know, big, big installations, they have trouble keeping up with what you know, I say, Oh, it's just a day to day. Kind of like if you've got some giant thing that maybe is


Will Vincent  20:55  

right I've seen here in Boston, the Jenga Boston meetup, people who are you know, very experienced developers on huge projects and they they literally haven't started a real a new Django project in years, you know, in a production sort of setting, so there's no way no one can do everything so much to do.


Carlton Gibson  21:13  

No, I mean, again, no, I still, I still think that you're buying


like the the analogy I was using as you're buying a car, not an ornament, right? And if the amount of when you when you use Jenga, when it when you when you build any piece of software, Oh, right. Like a car, it needs maintenance, you can't just put it on the shelf and look at it, if things will break and there will be security issues. And then we'll be operating system updates that require you to install the latest versions of libraries to keep running bit rot. It really happens and if you don't maintain your car, your car breaks down. And if you don't maintain your web application, your web application will break down. And it really is a small amount of time that you have to allocate each month each nine months each major release. allocate that time Upgrade your application. And then not only does your car keep running, does your web application keep running, but you can benefit from all the new features.


Will Vincent  22:08  

And it'll save, it will save you time. I mean, there, it's also it'll help you hire because you and i, you and i both work as consultants if I see a code, but you know, one point, I just had this very recently 1.5 code base enough, you know, I go, I don't want to fight with that.


Carlton Gibson  22:21  

No, maybe if the cross compiler choice.


Will Vincent  22:24  

I mean, that, you know, I think what's more common, is you'll have a code base that's old, but has at some point customized and gone off off of Django. Yeah. You know, again, I just had a conversation before we record this with someone he's on one five, they had developers who build something custom and now they don't know how to keep up. Yeah. So I think that's that's probably a little more of why companies are resistant and get so far behind is because you have that custom out custom features. And


Carlton Gibson  22:55  

but I think No, okay, at the time is that like, you know,


there's a backlog of features, there's always about Bugs is always unrealistic deadlines being set, and the maintenance just doesn't get done. That's technical debt. Yes, the


Will Vincent  23:06  

story of software. But if you are a, you know, a somewhat technical manager, and you're trying to hire just for hiring alone, update, update chango update, update update. I mean, I was just at it last week, we're gonna do an interview with a company that's big growing company, and they are on the latest release of Django and they allocate the time, and they're trying to hire 30 engineers this year, and they're gonna have a lot easier time saying, you know, we are up to date. Yeah, no, I'm saying we're on whatever version because we don't have the time to do it.


Carlton Gibson  23:37  

Yeah. And it tells you something about it to tell you. You know, I don't want to upset anyone, but it does tell you something about the company if they can't decline. To maintain the product technical debt is real. And if it's not managed, if it comes out of hand and you end up in a position where your day to day work is


not enjoyable because you're polishing this,


Will Vincent  23:58  

this thing, your life Have a car instead of a brand new, well maintained, you're driving


Carlton Gibson  24:03  

a car, which is leaking oil over the road. Right?


Will Vincent  24:07  

Yeah. Okay. Well, I think we've covered Is there anything else we want to cover on the major points of Jango versions? Because this is something that no one could do for a long time.


Carlton Gibson  24:15  

Yeah. Like, you know, the LTS is important. And it plays an important role in there are some companies for which it's appropriate. But in general, I would say you should default to being on the latest major version. And you, you must allocate that time every nine months to update it.


Will Vincent  24:32  

Yeah. And if you run it with a warning flags and run your test suite, it as I say it should be able to, it should not take huge amounts of time if you have kept it up to date up to this point.


Carlton Gibson  24:43  

Yeah. And that's what's good about Django now, in the last few years, rather than, say Django five, six years ago, where things were much more liable to change.


Will Vincent  24:52  

Yeah. Great. Awesome. Okay. As usual, you can leave comments at our website Jango chat. COMM or on Twitter at chat chango and we'll see you all in the next episode. Bye bye