Keynote: Django 6: The Most Exciting Release Ever with Karen Tracey

This video features Karen Tracey at DjangoCon US 2026 in Chicago, Illinois, USA.

Keynote: Django 6: The Most Exciting Release Ever with Karen Tracey
0:37:34
Published October 26, 2026
317 views

Django 6.0 has multiple very exciting new features, including:

Template Partials
Background Tasks Framework
Content Security Policy
Modern Email API

In this talk we'll discuss each of these features, illustrating why you may want to start using them as soon as possible. Additionally we'll cover some tips and tools for a smooth upgrade experience. By the end of the talk we believe you'll agree that Django 6.0 has earned the accolade of most exciting Django release ever.

This talk was presented by Karen Tracey at DjangoCon US 2026 in Chicago, Illinois, USA
https://2026.djangocon.us/talks/keynote-wednesday-django-6-the-most-exciting-release-ever/

LINKS:
Follow Karen Tracey 👇
On Mastodon: https://fosstodon.org/@kmtracey

Transcript

5,985 words · auto-generated · en Show

Automatically transcribed, so expect mistakes in names and technical terms.

0:14

Speaker 1: Thank you for coming. Thank you for inviting me. Thank you for accepting my talk. I'm very excited today to talk about Django 6, which I have labeled the most exciting release ever. uh which you may let's see you may respond to by saying how could that possibly be? Django Uh has been around for twenty-one years of releases. Could you really have the most exciting release coming up so recently Uh and all I can say is I've been around for 20 of those 21 years and my genuine reaction on reading the release notes for Django 6. 0 was, wow, this is there's a lot packed in here. There's a lot of really good things in here. So I thought we could talk about that

1:01

Speaker 1: and some of the things that I find particularly exciting in the Django 6. 0 and 6. 1 releases Depending on how much time we have at the end, maybe you're gonna come at me and say, hey, no, there's there's more exciting releases in the past that really should have gotten more attention. Um but we'll see how that goes. Um Just a little bit about me. I said I've been here for 20 years of Django. It was almost exactly 20 years ago now that I first started using Django for a hobby project. That was before the Django 1. 0 release. And I had some, I was bringing my own existing database to a project and I had some issues. There were some weirdness around that database that didn't quite agree with the utility

1:46

Speaker 1: Django. had to inspect the database. So I almost immediately got into reporting issues and was invited to create a patch and That worked out. And um so I started getting involved right after starting to use Django. I started getting involved in helping develop Django. And I spent a few years after Django 1. 0 came out, I did become a core developer and I was involved in helping get subsequent releases out the door. And so part of what I think for people who have been here that long, maybe some of those earlier releases you would have found more exciting. I don't know. But being behind the scenes and sort of being re deeply involved, maybe I didn't see it as that exciting. So you may have a different opinion and I'm interested in hearing what other people think.

2:34

Speaker 1: So we'll see how long I talk to see if we talk about, uh, have a chance to talk about what other people think. So what is it that I find so exciting about Django 6. 0? This is specifically 6. 0 that I'm talking about for most of the talk because that was what was out when I started, when I proposed the talk. Um and the picture I put here is an AI generated uh highlighting four big pretty flowers on a background of a lot of smaller little flowers. And so I'm going to talk about four big things, but I did want to mention there are little gems throughout the release notes. You should read the full release notes, including the miscellaneous section, to see what all is in there that might appeal to you or your particular project uh

3:27

Speaker 1: particular address some particular pain point you have. There's always more than the big features. The four big features that I will be talking about are the Python Modern API, and these are in order of increasing level of my own excitement. And So we'll talk a little bit about Python Modern Email API, and then there's also uh the content security policy, which I think Eduardo mentioned yesterday is being excited about coming. There's the Background Tasks Framework, which I've seen at least two talks here about pluggable back ends for the background task framework so there's I know there's more excitement about that and then there's template partials which there's a talk later today about template partials

4:12

Speaker 1: so at least have some uh other people also excited about some of these features. I haven't seen anyone talk about the my modern Python API, so I'll start briefly with that one. And that may be because it's not a really big change for users of email in Django. The email API provided by Django is largely unchanged. But Django itself in providing email service to its application clients is now using the Python 3. 6. cleaner and more Unicode friendly un um email API. And there are a little there are there's a some deprecations involved in this, so over time uh

4:58

Speaker 1: you may need to change your your email code in Django if you have built off of some custom classes, for instance, that Django used to use But with this change, you as a user of Django's email API would get back a Python email message class instance rather than a custom Django O class instance. it did kind of the same thing. So you get access to that standard Python class and everything that it does, which maybe a little more capable than it had been in the past. And what I find exciting, uh As I said when I gave this talk as a practice talk last week, I need to come up with

5:46

Speaker 1: more synonyms for exciting. I like this feature because it's uh it it's health, it's healthy. It indicates the health of Django, that it's moving along with Python, it's picking up the features that Python is adding. And where in the past, as an outsider now, uh from you know Django Core, I would expect in the past Django had to build a certain amount of glue and and scaffolding code to adapt the a the API that it wanted to provide for its Django code projects. to adapt that to a a less capable Python API and now with this that scaffolding and glue code can be slimmed down and be less less to maintain in the future.

6:31

Speaker 1: So that seems very healthy for the project that that kind of thing is going on and getting included. So that's my first exciting feature of Django 6 Second is content security policy, which uh I'm not a huge fan of security. Well, I'm I mean I am in that I I I like the intent, but the annoyance of having to deal with all the all the things is uh as an application developer and just get out of my way and let me do what needs to be done. Um so content security policy, uh You could have a whole set of talks probably about the specifics of it. So I'm just going to cover it high level and briefly and describe what's um

7:20

Speaker 1: been added to Django. It is W3C standard. The aim is to prevent code injection so that you can write your web application and be sure that the browsers are getting just the code that you wrote. not the code that got injected by some bad actor. And the overall way in which it works is your application provides headers. in responses that indicate what code and images and what content should be trusted by the browsers and then the browsers implement um following those rules. And like the CSRF protection, that may mean that the same magic value needs to be provided in two different channels, like in the header and in the content, as a value of a nonce for instance, and like CSRF protection.

8:06

Speaker 1: what Django has has j by Django supporting this you have easy ways to to make sure that those values are set correctly and you can lock down your application so that it has um less ability, l less hopefully exposure to injected code. Um there was uh at least one project, Django CSP, that provided this as a third party package, but it's very encouraging and Excellent, I think, that Django has incorporated that into the base because that elevates the visibility to the application programmers. When you read the Django release notes, there's this. And when you read about configuring your application now, it's right there that you should be worrying about

8:52

Speaker 1: setting up content security policy and deciding what your content security policy should be, how to implement it. So it elevates the visibility of dealing with this and it simplifies the implementation. You don't have another third party package that you have to bring in and manage. So I think that's exciting that Django has included that. Third, we'll move on to background tasks. And we, as I said, I've heard at least two talks about background tasks. pluggable back ends for the background tasks. So probably everyone understands what background tasks are in a Django application. You have a web server, you get a web request It asks you to do something that requires perhaps some extra work to be done that you really don't want to be doing on the request processing thread because it may involve talking to another server

9:45

Speaker 1: that may be slow. block your user request. So you'd really like to be able to say, okay, this is a package of work. I want to go and queue it up to get done later. Until that this background task framework has been added to Django, there was no standard way in Django to do that. There were third-party packages that provided background tasks in different ways. So you as an application writer Particularly if you were writing an application that or a package that could be incorporated into other people's projects, you had no standard way of saying, I want to do this work. I want to do it later. An example of that is Wagtail. Wagtail has a number of things that it would like to do as a result of the user doing something in the admin.

10:31

Speaker 1: uh that it really shouldn't be done on the the request processing thread, but it couldn't dictate a way in which to do that. So by default it would just do it on the request processing thread. until I think it was Wagtail6. 4 added support for the using the Django tasks. package and it's the Django task package and that implementation that eventually got pulled into Django and that is what the Django background task framework is now and that allows your code in a reusable way. to define what these background tasks are and queue them up to be performed and retrieve any results from them. So that's

11:16

Speaker 1: it's a framework for how to set up this work. It isn't end a framework for implementing a backend that actually does the work. And Django 6. 0 itself doesn't really provide a production ready backend. So there's two back ends provided. One allows you to run the task immediately. um when you enqueue it, the other I think doesn't run it doesn't run it at all. So those can be used in development and testing, but you for deployment would need to find a backend that does implement the back-end task in a way that works for your application. And there are there is the there is a

12:02

Speaker 1: database back end that it used to be part of the Django tasks independent package that has now been split out into its own little package that you could add to Django 6. 0. And as I said there are two tasks about um Two talks earlier in this conference that talked about one was Django Absurd and the other was uh implementing a celery backend, which is probably the most common thing you've seen people use. for back end tasks is doing it the celery way. Um but an issue with celery, to my mind, is it brings itself a lot of complexity and possibly a lot of other infrastructure you need. Celery, you have to choose what you're

12:48

Speaker 1: message broker is going to be what your storage backend for your results is going to be, there's configuration, there's more infrastructure. And in a lot number of cases there's Projects I've worked on, it's like this is beyond what we need for the needs of this particular fairly simple application So I think it's great that we now have a start at making it possible to standardize how this work is enqueued and how this work is then executed and I'm hopeful that there will be more backends that either thrive as third-party packages or ultimately do get pulled into Django I do think it would be really helpful if there was at least one production ready backend in Django Core to make it possible to have

13:33

Speaker 1: background tasks without jumping through many hoops. Okay. What am I doing? Okay. Then the last one I want to talk about is the one I'm most excited about. Template partials. This is also another thing that was a third-party package that ultimately got pulled into Django. And template partials are named reusable fragments of a template. The cool thing about that is that the fragment inside of a template can be rendered individually. As a render call, you can say, I don't want to render this whole template, I just want to render this little piece of it. And the image I have here is, imagine that's a whole template, and

14:20

Speaker 1: the highlighted bits are defined to be template fragments. And with HTMX Which I haven't heard a lot about here in this conference, but I'm heard about it a lot in previous conferences, so I'm hop hopeful most people know what I'm talking about. You can annotate your form to instead of uh submitting it and requiring a full page reload, HTMX will submit it and then take the response back and replace a section of the page. So you might see it replace just the upper portion. the upper right side portion of the page with the results of a form that you submitted. And this is a solution to a pain point that I encountered when I was using HTMX on a project. It was lovely to have the ability to

15:08

Speaker 1: submit forms and have interaction on a page that updated a portion of the page very easily. Um from a user point of view it was it was lovely, but from a developer point of view, every time I needed an HTMX response to just respond with a small portion of a page, I ended up having to take my template for that page and extract that little bit out into its own little files that it could be included. And that was that was not an ideal developer experience and template partials addresses that This is the one I'll talk a little bit more about the details of what you see in the template side and what you see in the backend view side. So template partials you get a new template tag, partial def

15:54

Speaker 1: to define a partial and I've named this one RSVP data. You can imagine that form on that slide, previous slide, was maybe you know signing up for an event and you want to be able to Gather the users' information, have them say they want to attend, and then respond with a message saying you've been signed up or something like that. So The name of this partial depth partial is RSVP data and the inline says actually render it right here in the template where I've defined it. You can also render a named template partial somewhere else using a partial tag if you want to do that, which is probably not something you want to do with a form like this. There are uses for

16:40

Speaker 1: template partials beyond the HTMX case that I'm particularly excited about and focused on. So it's a block template tag, partial def and the name. It has a pairing and partial def. Optionally you can specify the name if that clarifies things in your template. And then on the backend side, in your view, you can have a single view that is serving both the full page load of this page and maybe responding to those individual requests. So you may have code that has figured out everything that needs to be sent back in various cases, and at the point where you're going to render a response. You can check if if the request has come in via HTMX, and here I'm using the Django

17:29

Speaker 1: HTMX package to make that syntax a little easier. So if it's an HTMX request and you've figured out what to respond in context with that's in the dot dot dot, you just want to re render your template and specify it after the hash. the name of the partial that you want to render. So you can keep all your um locality, all your template interesting that what I noticed when I was doing this without template partials was like the most interesting things in a template were getting extracted out into these little files and it was hard to follow what was in the template. So Yeah, I think it's very helpful to be able to have it stay in one place and be visible and have the back end just be able to specify

18:16

Speaker 1: render this part of the template. And of course if it is a full page reload, if it's not an HTMX request, then you can just render the whole template with hopefully a full context of things. So that's everything that I want to talk about in Django 6. 0. And that was what existed at the point in time, I think, when I uh submitted this talk. But since then we also have Django 6. 1 coming out. So I did want to talk a little bit more about that because there's more exciting things that are coming in there. And uh okay, we're doing okay. Um there's three features I listed up there. I won't go into a lot of details. Um there's a mailers setting that lets you

19:01

Speaker 1: Similar to a lot of other Django settings over the years that have gone from you have one of these things, you have one database, you have one storage backend, you have one cache. you now can configure multiples. You can say there's a default database and there's another database that you may use for some things. Same thing for storage. You might have the same situation with mailers. um if you have different mail back ends um that you would want to use in different situations. And uh I suppose I have time to mention this. Uh just as an as I you may wonder well why would you ever need multiple mail accounts? I mean why would you do that? Um and what I found out recently with a project that is not Django. It has

19:46

Speaker 1: associated with the rescue I work with. If you if you have a form on your website that is open to the world that uh anyone can submit to and supply an email address that ends up trying to email that email address. That's a vector for attacking your ability to send email What we had on our web WordPress website for the rescue is a donation form. And what we had happen over the weekend was somebody decided to start testing out uh credit card numbers and see if they worked And they did that using a bunch of bogus emails. And WordPress saw enough of these bogus emails get bounced when

20:32

Speaker 1: the response was your this card doesn't work, um that it decided, ah, you can't send an email anymore. So We had to deal with that. So if you if you have to have those open kind of things on a form, you may want to have two different email accounts. One that you don't care if the email gets sent you know shut down And one that if you want to be able to reliably send email to email addresses that you have already verified are okay So that's a situation where you may want to have two different mailers. Um and there's other cases. Um I think the example in the docs talks about marketing versus transactional emails. So there's other cases where you might want to do it. Just as a developer I hadn't seen. this uh particular need in the before.

21:17

Speaker 1: Uh the next 6. 1 feature that I find exciting is a database level uh delete options to say Whether the database should handle cascade delete or Django should handle cascade delete. So up until this time, if you had an object that had lots of things that were going to get cascade deleted as a result of deleting it. Django would do a lot of work to do that and it would collect all those things together. And if you ever tried this in admin with something that had a lot of related objects that were going to get deleted, you may have noticed that you don't get the confirmation page that says These are all the things that are going to get deleted because it takes so long to gather them that the web server times out. And we've had at least one project where we had to write custom code that

22:07

Speaker 1: when a uh it's a client that gathers a lot of information over the course of a year and then they reset for their clients like throw away everything from last year, we're gonna start over fresh. So at the top level, they just want to delete the client. And the client has all this stuff that has been del collected over the years and it's going to take a long time to delete it all. So we have custom code that okay you marked it, deleted, you can't see it anymore in the front end. Overnight we're going to start up a task that's going to go and figure out how to delete these things from the bottom up so that there's not a lot of work needing to be done by Django to do that. It would be great to get rid of that code So I'd love to be able to use this feature and see if if I can tell the database, just delete this client, you go figure out all the things to delete. How quickly would that work?

22:53

Speaker 1: I don't know. I don't know how how much work the database itself would have to do to do that, but I'd love to experiment with it And then the third feature in Django 6. 1 that excites me is something called model field fetch modes, which for some reason I have a hard time saying. And what this is, is uh when you have a query set where you have said you want to defer loading some of the fields. And then later on your code gets goes starts to go down a path and it says it tries to access one of those fields you deferred. Django currently will say, okay, I'll go fetch that data for this instance. What model field fetch modes

23:38

Speaker 1: does is allow you to say, if I end up accessing one of those deferred fields, go ahead and fetch all of the fields for all the query sets, that's much more efficient than if you're going to end up touching it for all of the items in a query set, fetching them one by one. Or you might be going down a path where this just is one that you're going to need, so that's fine. Do that. Continue to do that. Or it may be that you never intended to access that deferred field, and it's a surprise to you that that Django, that your code went down that path. So that may be in indication of an error and what you'd like Django to do would be to say it raise an exception. So you can configure that behavior with model field fetch modes.

24:25

Speaker 1: And finally, the this isn't this isn't a feature in 6. 1, but it's another exciting thing that I find coming up that a couple of people mentioned in the last couple of days is Django is moving to an annual release cycle. an annual LTS release cycle starting in 2028. We've been on sort of an uh every two-year release cycle for LTSs with the. 0. 1. 2 For myself, I work on a lot of established projects that are somewhat Cautious and they want to be on LTS's. So the effect of Django's current release cycle has been these projects only get updated every other year.

25:12

Speaker 1: Um it's a that's means it's somewhat of a bigger lift to do it because you're actually jumping through three releases as you do it, go from one LTS to another. So it'd be a lower effort to um do it every year um for a smaller set of you know changes and I would get to use these features a lot sooner than I can now. Cause I can't actually use most of these features in most of my projects because most of them are on 5. 2. So and they're not they're not gonna move up until 6. 2 is out. So that's a bummer. Then there's one other thing I wanted to talk about as exciting. If you are excited by any of these features or not excited and thinking there's something else that I would like to get into Django.

26:00

Speaker 1: Uh Django is experimenting with a new way of getting community consensus on what is what is important to get in uh into. Django and that is uh the Django New Features GitHub Repo, which has a Kanban board uh view into it and you can see this is just a screenshot. You're not supposed to be able to read anything or not not necessary to read anything. It's been configured with the columns having um progressing from uh just an idea, a simple idea to see if people are interested, to an idea that's gathering a team and refining it, to someone's working on it. and to someone is, you know, they've got a working solution and they need review

26:46

Speaker 1: to uh this is gonna go into Django. We need someone within closer to the Django core team to um Shepherd it into Django O2 being done. And there are this is a screenshot from a couple days ago Uh there are how many? 38 things that are already done by via this process. So I thought that was cool. So if you're in interested in contributing if you have an idea for something that Django could add or fix or whatever take a look at the Django New Features repo. And that is the last slide I had that had content and I'm interested if anyone has questions or would like to challenge my assertion that six

27:33

Speaker 1: is the most exciting release ever. We'd propose something else as being the most exciting release. So

27:48

Speaker 2: who has uh questions for Karen? Let's see. There he goes. Okay, question back here from Eric.

28:00

Speaker 3: Yeah, I'd just like to hear a little bit more about the tasks framework. Uh I'm pretty excited about it. I think that's a huge thing that a lot of Django developers hit pretty early. Um and I'm just curious kind of a little bit more about the process behind it and kind of what uh like what what the path is for actually getting that production back end into core is that just kind of formalizing that database backend or just a little more curious about what the next steps there are?

28:26

Speaker 1: I don't actually know why the Django tasks database backend wasn't included. Someone may have an answer. Someone who's closer to Django.

28:38

Speaker 2: Natalia has her hand up over here, so maybe this is the answer.

28:42

Speaker 4: Hello. I'm one of the Django maintainers. Uh we didn't include the database back in because it wasn't So it's a production ready backend, but it's not yet quite production ready. Okay. We discussed it with Jake. They are using it for some things in Wagtail. So we have a plan. The idea is to include it in as soon as we can. Jack Jake has had some personal developments, so we're leaving it behind. But the plan is to include it for sure in in Django Core. It's just need right now it's an external package so people can use it. So the best thing that you could do is use it, report issues or help contribute to the stability of the backend But it's definitely something that we want to include in Django.

29:25

Speaker 1: Yeah, and even without it in Django, like if you're if you're excited by having a b uh this solution and using it It just in researching doing this task, uh doing this talk, I found blog posts that talked about here's a back end I wrote and it's really simple and it uses this and there's the Django Absurd one that used Postgres workflow something that I didn't I didn't know what that base was, but there's there's also the ability to write your own that works for your project. Um, and that may be good enough. Or like there was talk of the celery one yesterday, I'm hoping hoping there would be a third-party package that provides compatibility with celery fairly soon too. So

30:12

Speaker 2: Okay, more questions. Alright, I've got one. If you could wave a magic wand and take one of the new features out of the new features repo and implement it in Django immediately, which would it be? This would put this in Django would make it even better than Django 6. What new feature would you add into Django if you had the option?

30:47

Speaker 1: I don't I don't have any big need that I feel is unmet at this point.

30:52

Speaker 2: That's okay. I'm going over to Tim and the steering committee. Let's see what he's got to say. Is it committee or counseling that right?

31:04

Speaker 5: Thank you, Karen. I've really enjoyed your talk. Since you highlighted the new features coming in and also you pointed out several of the new features came in as third-party packages, one of the things we're trying to do uh on the steering console is like identify or Make third party packages a little bit more robust or like uh accessible to people. And you mentioned that you could only upgrade your applications from LTS to LTS. Like do you have any ideas on how we can make the third party ecosystem um More robust or like more accessible to people where it's that's all of the features in Django rather than just in Django? I I hope that question makes sense.

31:43

Speaker 1: Kind of. Um I mean there's there was um I'm blanking on the name Jazz band that was a way to sort of gather up support put supported packages and have a team that was supporting the packages but that has been retired. You have a new one, don't you? Commons. Commons, Django Commons. I think those are excellent efforts. It I think that would be good to have like a collection of third party packages that are not just single maintainers because over the years of supporting Django

32:29

Speaker 1: applications, you pick up a third party package, it looks like it's healthy, it provides what you want. And then two years down the road you need to upgrade and it's the maintainer's gone and you end up having to having to adopt it yourself if you want to continue to use it or find something else. So I do I do think that that approach of gathering together a group of people willing to put in the effort and have it be a group and have it be associated with Django. is a useful way to do that. And I would hope that continues in Django Commons now that Jazz Band is gone.

33:10

Speaker 5: Great. Thank you.

33:14

Speaker 2: All right, Jeff, I'll go to you first, and then Paulo. Sorry. Um

33:21

Speaker 6: amazing talk by the way. Um in the spirit of like love it or leave it, are there any features in Django that you have a particular love or leave it feeling that you know you would want to see stay? We have so many batteries in Django and there's kind of talks of removing batteries, adding more batteries to it. But any thoughts on parts of the framework like that?

33:40

Speaker 1: That I would want to keep particularly or

33:43

Speaker 6: either way.

33:49

Speaker 1: I know that's it's been a perennial redo admin. that hasn't happened. I think in its current form it's great still. Uh so admin and the ORM of course you'd want to keep. Uh personally for me, uh I can do without async support. Just doesn't excite me. You'll notice I didn't mention anything about async. I it's not a need that I've had. That's about all I can think of that I would I I I mean there's so much in Django that I uh Forms and forms and server-side rendering and everything that lets you do

34:37

Speaker 1: with HTMX and some JavaScript on the front. Nice applications nowadays. That was something that I really, uh, Forms in particular was something that I really missed when we were all on a f heavy front end framework and matching like the you need to redo your validation in two different places. I didn't like that at all. So I the forms with the modern abilities of um updating the page. I think is also very valuable and would want to keep.

35:15

Speaker 7: It's great to see that after twenty years you are excited about our release of of Django and I can say that I saw some of these features to be developed during sprints and people were excited to finally finalize this. and this pull request uh one has been last year the Django on demand sprints and also people getting excited to to work on that And um Cartoon and Lily presented has the new feature repository, which is great. And uh what Do you want to suggest people to work on during the sprints that we have here in Django uh Kong

36:00

Speaker 7: US or the feature do you want to work on if you are participating during the sprint?

36:06

Speaker 1: I want people to work on the things they want. To get done. And I would encourage, I would echo something I heard yesterday, look to see what's out there in a pull request already and see if anything there that needs review appeals to you and maybe help moving it along. versus starting on something new. That would be what what I have usually done at Sprints when I've been able to attend is find a ticket that is I one time I was like, I'm gonna find the oldest ticket in track. Tackle that. Um But I think the way to get in the way to uh sustainable involvement is to work on what is important to yourself.

36:54

Speaker 1: Otherwise, if you're just working on stuff that is important to other people, but you don't see the need, you're probably going to lose interest. So I would encourage people to f find what they would like to see added or fixed. And focus on that and maybe focus on seeing if there's existing stuff that that addresses some of their pain points that could be reviewed and moved along

37:17

Speaker 5: Awesome. Any more questions? All right, let's give Karen one more round of applause, please.

37:23

Speaker 1: Thank you.

Presenters

Conference

DjangoCon US

August 24 - 28, 2026

Chicago, Illinois, USA

Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.

More videos by Karen Tracey

More videos from DjangoCon US