Improving One of Django's Most Used APIs — Not the One You're Thinking Of

This video features Andrew Miller at DjangoCon Europe 2026 in Athens, Greece.

Improving One of Django's Most Used APIs — Not the One You're Thinking Of
0:25:55
Published October 26, 2026
167 views

TALK: Improving One of Django's Most Used APIs — And It's Not the One You're Thinking Of by Andrew Miller

What Could Django Provide? Packages like django-prodserver give us a safe space to try ideas in the open. What naming makes sense? What hooks should Django expose for the ecosystem to build on? Could this eventually lead to production server support in core? I'll share some thoughts and invite the community to shape what comes next for prodserver and more broadly for designing new APIs through the experimental API feature that has been proposed. Takeaways Attendees will leave with: - A new way of thinking about Django's CLI and settings as API surfaces - Practical knowledge of django-prodserver they can use today - Ideas for how the community can shape Django's deployment future - Considerations for API design and how the experimental APIs proposal could open new paths for Django's development

More information: https://2026.djangocon.eu/speakers/RBQPU8/

Follow DjangoCon Europe on social media:
*X - https://x.com/DjangoConEurope/
*LinkedIn - https://www.linkedin.com/company/djangocon-europe/
*Mastodon - https://fosstodon.org/@djangoconeurope

#django #djangocon #djangoconeurope #djangoconeurope2026

Transcript

3,523 words · auto-generated · en Show

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

0:02

Speaker 1: And I'm really looking forward to the session and I don't have to introduce to uh YouTube Andrew Miller, but I'll do anyway CTO of Hamilton Rock and he runs Software Craft, the Django consultancy out of Cambridge, in the UK, so he knows what he's talking about. So uh don't rest while you're listening to his talk. He's the creator of Django Prod Server, and I think we'll learn more Big applause.

0:35

Speaker 2: Morning folks. Uh yeah, so today is about one of Django's most used APIs And I don't think it's the one you're thinking of. So, as I was introduced, if you didn't catch the lightning talk last night, this is me in a slide We've already covered the work. Django community, I'm online community working chair, I'm admin in the Discord, and I organise socials. And I'm Nano Republica most places online. So that's me. So today's journey, we are gonna talk about APIs. Give me one sec, I've just forgot I want to reset my timer. There we go. Um APIs are everywhere. And we're then going to focus in on one popular API that I think needs some improvement.

1:24

Speaker 2: And We're going to talk about a possible solution, a demo, and then where do we go from here? So this is going to have some audience interaction I want you to shout out. What do you think when I say Django and APIs? DRF, you're not going to be able to do that. Shout again. Ninja, so here we go. We've got the the rest story, the classic rest story. But some of you said it as well Do you think of models, forms, settings, manage. py? They are all, for better or worse, APIs, and they need to be designed appropriately.

2:10

Speaker 2: Ideally, the clearer the better. So another question for you. Which is the most used API in Django? Um to clarify, there's no stats here. This is my gut feel and it leads the rest of the talk. So shout out again, which is the most used API in Django? I'm just getting noise, but It's probably settings, but we're gonna talk about runserver. It's um It's the one everyone uses day one. It's the first, second command you run after start project maybe or start app. It's the one everyone knows. What does this design communicate? The word run server.

2:55

Speaker 2: Shows you how to run a Django project. It's clear, it's simple. Beginners get something working immediately. But what isn't it communicating? There's nothing about the environment. It doesn't say development on the tin. There's nothing about any extra configuration required for production and Django's as batteries included, right? So that's all handled from a beginner's perspective. Um let's now consider this command. This is your standard production whiskey using Unicorn. Again, still really nothing about the environment. You could use this in development, you could use it in production. That's fine. Um it's verbose. There's a fair amount of

3:42

Speaker 2: configuration that I have no idea as a beginner what that means. What are workers? What is bind mean? I and there's a file, there's possibly a reference to a file that I've not touched in my start project which is the whiskey. py. I'm like, that's the only place Django appears. What's it got to do with Django? So the core question, can we improve the API for running Django projects? Hold on to this, this is the core question. But first, a quick story. Um since joining the Discord, I've had numerous times where I have said Don't use Janga, don't use Run Server in production because someone is trying to do that for the first time and it's like, don't the general advice, don't do that. I know there are exceptions.

4:28

Speaker 2: So this is one of these times back in 24 and it hit me like a ton of bricks. What if run server was called dev server? Would you have made this mistake to the newbie? And he's like, yes, definitely. In the next update, please. That's obviously not gonna happen, but that's someone's desire. Um so run server, the name was the problem. That's kind of where it hit me like a ton of brooks So, when thinking about running a project, there are two environments to consider: development and production or production, like you've got pre-pod, you've got staging, a deployed environment. So development Already has an API. Run server exists. It's not perfect, but it does the job.

5:15

Speaker 2: And the rename would be technically simple. Um any of you can go and do that today. It's create a new file called DevServer. You have one simple class, base command it inherits from runserver, you're done. Um probably some warnings with the deprecation policy, that kind of thing. But We as a community are community-driven, consensus-driven, and we like to be stable. That's Is um to quote someone from the um well I I'll come on to this, but perhaps it's too well entrenched to rename. The other side of the coin, production is missing a cohesive API. There is this gap.

6:02

Speaker 2: And when I say talk about production, there's deployment and production here. Running in production, but also getting your code from your laptop up into A server. Beginners make mistakes, they're not even sure what to do, there is a gap there. We all know there's a gap. We have documentation, the documentation's great, but no one reads the documentation. especially not beginners and with AI less so probably. So as I said, I tried to fix this. In my example, I in my enthusiasm, sorry, I Made a proposal on the forum. Big idea, let's do these two things. Rename it and add a new server, a new command to for production. You want both. Renaming makes no sense without the other.

6:48

Speaker 2: So, but it was too much in one go. So I started smaller. I personally use In development, uh Django extensions run server plus, which uses WorkSig under the hood. And that shows a nice little warning of like this is for development only, do not use in production Um so I was like, great, let's propose them. And ooh, success. Track ticket, pull request. And for me, this was a win. At the time I was doing Django Naut Space, and this was proposal, track ticket, pull request, co-review merged, shipped in 5. 2. And the result is that you've probably all seen it.

7:34

Speaker 2: And the feedback has been mixed. Experienced devs go, why do I have two extra lines that I'm being bugged every single time? And also, beginners may just miss it. The time between First reading that and then ignoring it as you develop your project to getting it in production, they might completely forget about that warning. And it is just adding noise rather than actually solving the core qu the core question we posed. So, there we go, feedback's been missed. So, what's the solution? Um, as I say, it's a well-considered and well-designed API, but without boiling the ocean Boiling the ocean. We could add our own server into

8:20

Speaker 2: Django, but the first part of the tutorial says we're in the business of web frameworks, not web servers. So that's off the card. We could depend on other servers, but that again it like I'm saying it doesn't really go with the grain of Django. We don't have many dependencies, like two, I think it is. So But we do already have existing patterns and APIs for how to go about this. So this is where Django Prod Server comes in It's a package, as I'm saying, to allow you to call your production servers through manage. py. Very simply, you

9:07

Speaker 2: install it with one or more of these configurations. The extras are so that it installs that server or extra package in for you as well. You could just install the package itself. You then add it to installed apps, and then you add this to your settings file. You can have multiple processes defined, give them a name, whatever you like. And then running becomes that. That kicks off Unicorn. As a bonus, I've also included Dev Server, so you've got just a nice matching. Again, don't have to use it. One thing that should be really clear about this is it's all optional, right?

9:55

Speaker 2: If you like how you run your whiskey and servers and that kind of thing, go right ahead. So Demo time. Let's see how this goes. If I can. So I have A simple project. It's a task management template project that I've created. Has projects, has tasks. You're looking at a proc file right now. I'm usually going to use Honcho later just to run it to emulate, say, being on Heroku or something like that. If we go to we've got a login page, refresh it, it's running. This is running with dev

10:41

Speaker 2: server right now, as you can see on the Right hand side, left hand side? Your right, my left. Um and yeah, as you as I showed, you've got this unicorn configuration there. So I can If I control C out of that, you can do not that I can see what I'm typing, honcho start. That's now running unicorn on 8002. So if we go back to This one. It looks horrible because it's production and I haven't run collect static or anything like that. It's you can tell the difference. So next step is to add uh

11:28

Speaker 2: add prod server. So if we go to Live typing never works. There we go. Oh let's do waitress. Oh no. I did have this Never mind, let's just do it without waitress. I have Yay, there we go. Prod server installed. Now let's go to we go to our settings file.

12:17

Speaker 2: Find installed apps. I'm going to be copying and pasting. I meant to do this as prep and then completely forgot. So This is all very and then we can it add our configuration. Go down to the bottom. All very simple. Save it. And then, so this currently, that's all the settings you need. I'm going to change that to eight oh two. Then the final thing to do in our prop file is we can

13:04

Speaker 2: delete all of that and just do Manage. py pro if I can spell hot over web. Oh thank you. Right. So nothing's really everything's changed and nothing has changed. So if I control C out of that. I do honcho start again. Oh look at that. None type. But did I have an extra space somewhere? Where did I have the extra space?

13:51

Speaker 2: Settings, okay. Uh except the the first is already told apps. No. Oh well there's an error. Yay, never do live demos. Oh no. But uh okay. Something's happened because actually it's error. I need to go and fix that. But essentially it would have run the same thing. It's Non-type. I'm not going to live debug that now. So if we go back to the slides, give me. Before we've added it, it should be running. Um the thing I want to point out is

14:36

Speaker 2: changing to say a different server is simply a matter of changing This bit to another server. Say you want to play around with ASGI or something else. It's a one-line change. It's not out in you need to install the actual server, but it's it's a one-line change. So what's next? This is the first version. I would like to add same defaults for each process backend. What same defaults are? That needs to be worked out, but it means, for example, at the very least, you don't have to specify the bind, you just it's done for you. Um maybe it pulls port from environment variable, that kind of thing.

15:23

Speaker 2: But really the it's getting the the names right. That's the bit I care about. So and other parts of the deployment story. So in terms of the names, I was speaking with Jake. He wants managed. py worker eventually So currently at the top we've got dev server, prod server web. Could it be manage. py serve? Could it be run server dash dash dev dash dash production? I don't know. Um this is my first go. I would love opinions on this. I've done some polls in the past. When it comes to deployment, it's just one bit of the story. There's setting up production. There's pushing code, there's doing configuration in your project, but also in the environment, and then there's running production.

16:14

Speaker 2: We saw yesterday um part of that with Django simple deploying the lightning talk from Jan. Prod server covers the last bit of this story. We do have check dash dash deploy in the checks framework. But for me it's the big question is who owns Django's deployment API? What does that look like? I'm not saying it should be in I'm not saying any mechanism should be necessarily being core, but maybe the API is defined in core for other people. to implement. And that leads me on to this. Django is an API to me. It's not just a framework, it's a set of APIs that we build on. It's why I can make ProtServer because we have this idea of extending management commands.

17:01

Speaker 2: Because we have a settings. py where I can add things that I need. It's all about the contracts that Django defines. I think the task framework is an excellent example of That in action. 6. 0 release tasks. It did nothing. It caused a lot of confusion because people were like, how do I do this? But it's like, go to a third-party package and use that. And also Huh not hundreds, but loads of third party packages started popping up, filling the gap. And it's that 's what we want. Can't all go in core, but the core should define the contract. Um getting it right leads to that progress. Getting it wrong leads to the confusion. Run server causes confusion for beginners. And will take years to correct um

17:48

Speaker 2: or does it? So I land with this. Um There's on the new features repo an experimental APIs proposal that uh is about adding feature flags inside Core Django so we can move faster I was asked to mentor this project. It's a Google, it's been put forward as a Google Summer of Code proposal. On the flight over, I got my list of ten down to five. On the flight back, I'm probably going to get it down to an order. But my big encouragement is please be active on the forum this summer. I don't want to be the only one defining how the future of

18:34

Speaker 2: These experimental APIs go into Django. My goal for the project is simply consensus and documentation so we all know where we are with these potential experimental APIs. And when I say experimental, I mean could ProdServer go in as an experimental API into core? Do we like it? it then doesn't have to follow uh the deprecation policy or what I say it doesn't have to follow it. We have to redefine what it means in terms of experimental APIs. There's a big gap there that we just we haven't don't even have a definition for what experimental is. So, back to the core question. Can we create a better API for running Django projects? Yes, I think we can.

19:22

Speaker 2: But there's still a lot of work to do. So briefly, what have we covered? APIs are everywhere. We use them every day. But they need to be carefully considered in their design. Django 's deployment API is incomplete and run server, I think, miscommunicates its intent especially. to beginners. Django is a set of APIs and we we have packages, we have the third-party ecosystem to prototype new ones, and that's where most of the work should be done. Forward deployment, for me, prod server is a path forward on the deployment side. But there's still a lot more to do. Try it, give feedback. I'd love to hear issues. Um there are issues on the project. There's two types of issues on the project. There's development ones, but then I've also started a marketing project

20:08

Speaker 2: because as a community you as soon as you publish a project as soon as you publish a project you then have to be a marketer to kind of go how is the community going to use it. So there are ideas I want to work on that in public as well Uh help yeah, help let's help move deployment forward. Thank you. Any questions?

20:36

Speaker 1: Thank you, Andrew. Yes, questions. Hard to see. I have a frontline question.

20:48

Speaker 3: Thank you, Andy, a lot for for this and for letting us um think about this this point. Do you think that the problem you are trying to solve will overlap with the the other projects uh in this field? uh it sim Django simple deploy it can be done something to solve the the final problem of for every everyone to start a project and to deploy in production easily also reliably

21:18

Speaker 2: Um so in the case of where prod server where I'm so in the case of simple deploy. For me, it will be opening PRs on Simple Deploy plugins to use prod server in under the hood. So someone using Simple Deploy at some point won't even know that they're using prod server until they're they've done second or third or have to go in and have a look. Similarly, I've got a PR open on Django Cookie Cutter for that to start using it. And so it's that's where I'm targeting in terms of of getting adoption because it's at the beginning of the project really where you want it installed. So people yeah

21:59

Speaker 1: thank you. More questions? I've got one here.

22:07

Speaker 4: Yeah, thanks. Um something which bothers me with the management command is that if you have a uh third party application that the you Uh you it's easy to have a naming conflict between that management command and the management command which might be have the same name from another third party app So do you believe it would be possible to make something like run server, then app name, and then what whatever is the subcommand from there?

22:41

Speaker 2: Yeah, I so in terms of conflicts with management commands you can alias so at a project level, individual project level, if you've got a conflict. You have to resolve that. But I think in terms of like say run server and then an app name, that's That would be down to the project. That's a good question. It would be defined in your settings. py, so I wouldn't expect a third-party application to necessarily define a process for you to run. It would be your project running it. Am I answering correct? I would expect you to have full control in the end project rather than third parties defining it, what they're gonna be called. So

23:29

Speaker 2: Yeah, we could uh again, I was talking with Jan on the first day of the conference and overall in terms of deploy, could we have a deploy namespace in the management so it's like deploy And things get moved under there just to do a deployment, that's something that could be explored. I have more questions than answers at this point.

23:49

Speaker 1: More questions is the keyword. I'm looking into the back rows now. I have

23:54

Speaker 2: Oh, I see one up there.

23:57

Speaker 1: Over there. Oh yeah. We we have runners. No what they do, they're running. Just one second, thank you.

24:14

Speaker 5: Hello. Hi

24:15

Speaker 2: there.

24:17

Speaker 5: Is it possible to def to calculate the number of workers? For the server?

24:23

Speaker 2: It's yeah, that when I say I haven't got same defaults worked out, that's given the so the server backends are just Python code. So you can use any Python tooling to work out those defaults. And so but I want to emphasize Defaults, it's something for when you first start. But if you're getting into situations where You need to know the precise number of workers or other options. There is always the escape patch. Also, you get to a certain scale. uh for example I'm not expecting Kraken or one of the or to use this really because they have their ex existing deployment practice is established and there's a whole team probably managing it.

25:10

Speaker 2: It's that first project, it's that second project. It's optimizing for all the future users of Django, not necessarily the current users of Django.

25:23

Speaker 1: Okay, thank you. One more big round of applause for Andrew. And one quick question. Are you here for the sprints?

25:38

Speaker 2: I would love to be, but I have to be back in Cambridge for nine a. m. tomorrow. So

25:42

Speaker 1: given feedback already today if you want to pass it Thank you so much.

25:48

Speaker 2: Thank you.

Presenters

Conference

DjangoCon Europe

April 15 - 17, 2026

Athens, Greece

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 Andrew Miller

More videos from DjangoCon Europe