Modern Django Deployments in 2026 with Will Vincent

This video features Will Vincent at DjangoCon US 2026 in Chicago, Illinois, USA.

Modern Django Deployments in 2026 with Will Vincent
0:25:16
Published October 26, 2026
726 views

Deploying a Django website is deeply confusing for newcomers, but it doesn't have to be! In this talk, I'll provide a conceptual and practical overview of the process to demystify it all and provide some hard-won lessons along the way.

We'll start with a high-level look at the architecture underpinning it all: web servers vs app servers, queues, security considerations, databases, caching, environment variables, and more. How to think about choices such as Platform-as-a-Service versus VPS? Managed databases? Docker? And more.

Then we'll dive into a step-by-step deployment checklist, looking at how to switch from their default local settings to something production ready. What are the minimum steps to deploy a web app? And what are the recommended additional steps to maximize security and performance?

This talk was presented by Will Vincent at DjangoCon US 2026 in Chicago, Illinois, USA
https://2026.djangocon.us/talks/modern-django-deployments-in-2026/

LINKS:
Follow Will Vincent 👇
On Mastodon: https://fosstodon.org/@wsvincent
Website: https://wsvincent.com/

Transcript

4,910 words · auto-generated · en Show

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

0:14

Speaker 1: Thank you everyone for being here. Uh I'm going to talk about deployment and why deployment, right? The best Django apps in the world, if they just live on your laptop, don't have real value. But that leap from local to production is a lot of steps, right? In fact there's entire career paths just around that. I'm going to reserve uh resist the urge to mention tools in this talk and try to zoom out one layer above to talk about what's similar across all Django deployments regardless of how big or small your application is and what hosting provider you're using. So who am I? I'm a developer advocate at PyCharm JetBrains. I've been around Django for a while. I do the Django news newsletter with Jeff Triplett if he's here. as well as the Django Chat podcast with Carlton Gibson, who unfortunately is not here. And I go to a lot of conferences in my role as a developer advocate, but by far the Django Cons

1:04

Speaker 1: are my favorite. So I'm very happy to be here. Okay, so this is your typical developer. And why is deployment hard? I think we ask too much of web developers. Be an expert in deployment, databases, security, authentication. Also be polyglot and comfortable with not just Python, but also JavaScript, TypeScript, CSS, HTML, these days Rust. the list goes on. And so that makes web development fun for many of us, myself included, but you can we get our hands dirty in so many areas, but you can also feel like you don't have deep expertise because you're constantly flitting about. And deployment is one of these, right? Again, there are if you take a website with 100 engineers on it that has scale, I would wager the majority are infrastructure engineers, not

1:50

Speaker 1: Django web engineers. Now if you look online for advice and help you if you look on Reddit, um you're gonna see everyone does deployment differently. Best practices are surprisingly hard to find, and everyone is recommending tooling inventors and focusing really on the specific details instead of what are you actually trying to accomplish. So on Reddit everyone will tell you you're wrong. If you ask AI, it will tell you you're right. And who's to know, right? So everyone thinks their choices are the one true way. Um and I it just leads to confusion. And I say this from personal experience. When I was starting out, I just Couldn't understand. I'd see people talk about milliseconds and millions of transactions and I was like, I couldn't even get this thing deployed. And they say, oh well I have this 50-step checklist to do it with the VPS, whatever that is.

2:37

Speaker 1: on a different platform. Um so hopefully this talk will help with some of that. So here you go. Just pick one, right This is a short list of available providers. I'm sure I've missed some. Not only do they all have different names and logos, and they also change their names and logos. I won't call them out, but you know who they are. They take very different approaches to deployment. So some are hyperscalers like AWS that offer everything, others give you just a virtual private server. Others are hosted platforms as a service, and many actually cross those boundaries, so it's hard to define and even harder to pick one if you're in a position to do so. But this is basically my talk and a slide, and I'm gonna try to back it up. Is that 90% of deployments for Django are the same, and I will show you why And again, I it's so easy to get caught up in long deployment checklists that you find somewhere

3:27

Speaker 1: or a colleague gives to you and you're just so mired in like getting one thing to work that you rarely pop your head up and go, it's not So bad. So I'm going to try to give you the map of basically every Django deployment. And again, I wish I thought this way. For years I really only had like, oh, this little bit is hard and it kind of works and I don't want to touch it again mindset. So this is the dream. The dream is just drag and drop, right? Why can't we just drag our local Django site? Everything works. The images show up, CSS shows up, like what's so hard? Why can't we just drag it? Uh and I'm going to show you in 10 steps why it's not quite so hard, but why it's doable. So step one. Um It can be hard to visualize exactly what the request-response cycle is. There are talks on this that I suggest you look at.

4:14

Speaker 1: But it's basically this, right? Request comes into the web browser. hits your server, hits your app server, and then your code. This purple box should probably be a circle. You can draw it multiple ways. We'll just say that's the Django part and leave it like that. That's a separate talk. But a request comes in and it hits middleware, URLs, views, templates, models, I could go on. The important thing though is that locally you don't Need to think about a web server. So again, if you're new to development, run server just magically handles all of this for you. So Some people in this room are long past that stage, but if you're newer to Django, I think it's a real what that there's two servers involved because you don't have to think about it. And then comes deployment and now you got to think about it. So again, in production they have to be split apart.

5:00

Speaker 1: And 20 years ago there weren't specs for how web servers and app servers communicated. I'm curious in this room does anyone remember CGI or mod Python by hands? Yeah, for those watching, that's a fair number of hands. Right, so now we have WISGI, right? Contract between your app server and code, so that you can swap them. And we also have ASGI, the asynchronous version, which is used by Fast API and things like that, but it came out of Django, Django channels. Thank you, Andrew Godwin. Um and it's still maintained by the community, most notably uh Carlton Gibson. All right, step two is the environment. So if you notice this is a dotted line. Because the code is mostly the same local in production, but the configuration is what changes. Again, back in the day, maybe show of hands, who remembers multiple settings. py files? Show here.

5:45

Speaker 1: Okay, like a third. I do. Um that was a pain. You'd have local underscore settings, base underscore settings, staging underscore settings. Now you can most people will have one settings. py file. You can use environment variables to load them in at runtime. Much simpler. And there's only a handful of configurations that are the bare minimum to get started. Those of us in this room probably know and love them. Debug, secret key, allowed host, database URL could go down the list, but those are the big ones you have to uh configure, but you can do it separately from the code itself. And I think that's really elegant actually. But you know, kids these days just hop in and that's how it is. So it was harder back then. All right, step three, the database. So locally you're almost certainly starting on SQLite

6:33

Speaker 1: because it's the Django default, it's file-based, it's fast. You can use it in production, which is another talk that would be really cool to have about changes and improvements there. But most of the time you're going to switch to a server-based one like let's say Postgres. Django supports five databases out of the box. Postgres, SQLite, MariaDB, MySQL, OracleDB, and there's also official support for MongoDB, and there's also third-party packages for other databases. You can absolutely set up a server-based um database for local use. You'd probably want to use Docker for that. You can get pretty far just using SQLite and then switching to a server-based one. I'll be honest, I do that on some of my projects. That's me being a little lazy, but You know, you don't have to go full throttle with everything when you're starting out.

7:18

Speaker 1: Um and also note that Django 6. 1, which just came out a couple weeks ago, Jacob Walls was The release manager. Um that requires Postgres 15 or newer. So if you're upgrading to 6. 1, you want to make sure your Postgres is up to date as well And last thing to note if using, I'll use Postgres as the example, you'll need to install a driver, Cycle PG. So you'll have a few extra packages you'll need for deployment that you didn't need locally. Okay, static files. Number four. So these are files that ship alongside your code but don't change per user. Think CSS, JavaScript, images, fonts. The very first PyCon US I ever attended, I saw Jacob Kaplan Moss, a creator of Django, give a talk titled, Assets in Django Without Losing Your Hair. So if a creator of Django gives that talk, you know that this comes to bite you.

8:06

Speaker 1: Um But again, locally it all just works. This only rears its head in production. So if you haven't had it happen yet, like it's a thing, you should know about it. The dev server handles it. Django stops serving these static files when debug is off, which is what you need for deployment. And so there's broadly three ways to handle this in production. Number one would be the white noise package. That's the default for many platforms as a service. I would suggest starting there if you can. You can serve it on your web server directly through Nginx if you're configuring and doing a VPS. Or if you have real traffic, you might look at a CDN, something like um S3, where you want it closer to your users, but again, that becomes an infrastructure question more than a Django just get it online question. In your code, these files will live in a static directory, which you can do in your project or in the apps.

8:55

Speaker 1: I prefer in the project, but that's one of those kind of religious debates in the community. And then the collect static command will compile them all into one place for deployment. Again, locally you don't have to think about it, everything shows up, but I've certainly deployed and then I'm like, it just looks like text, like it all looks ugly, and I couldn't understand why. So this will come for you. And I'll just say a note, there's media files in Django. Again, if you're newer to the community, those are user-uploaded ones, and you can't trust those at all, so you need to put them somewhere else, definitely not on your web server. Django storage is the third-party package. I use, there are others. Okay, so step five. So we're building out the picture of like what you must do each time. Authentication, how users sign up and log in. You might think, I don't need that, but how will you do a password reset?

9:43

Speaker 1: Now you don't have to use email, you could use passkey, you could do SMS. Increasing ways to do it. I'm just gonna use email as an example. You need some external way for someone to reset their password. Um locally, again, this is not an issue. You can fake it, you just run the create super user command. Um But a mistake here in production will get you in the news in a way you don't want to be. So um email service is another API key we can update in environment variables. And again, uh 6. 1 gave us a proper shape with the mailers dictionary that looks similar to databases and caches. Do check that out if you haven't. I know people, Karen and others talked about that. Um And also of note, um replacing the email underscore uh

10:28

Speaker 1: wildcards setting which will be deprecated as of 7. 1. So Django is giving you a long time to update your stuff. All right, so more than halfway through, got our public auth, but now we have another problem, which is where we go next, which is security. Um so I think we take for granted how good Django is at security. If you go and try another web framework, it's kind of shocking how not as Into security they are, even though they might have a lot of scale. And again, this is not a new box. Instead, we're hardening uh lines already on our existing box. So it's not a security and deployment is not a thing you install. It's defending the connections, as I said, between the boxes we have. And again, locally, it's just you on your network, everything's fine

11:14

Speaker 1: in production. Public internet everything is a threat. So the first thing I would say is start with HTTPS. You can put that on, but that's not enough because it doesn't protect the session cookie, which remembers who you are, so that must be hardened directly as well Second, once the page is loaded, we can't trust it not to run somebody else's script. That's where CSP content security policy comes in, and that's a nice Django 6. 1 feature. I think that's been covered with the content security policy middleware. Third is set debug to false and then update allowed hosts. And I just stop and say, like, even for me, after a decade plus of doing this, I can't remember all this off the top of my head. So I have my own deployment checklist. So like don't feel bad if you're like, wait, what is that thing? Like it's too many steps to memorize and you're probably wasting your time if you do.

12:03

Speaker 1: Just know that there are public checklists. I'll talk about Django has one. You should have your own, but don't feel a need to internalize all the steps. Just broadly be like, oh, there's a whole bunch of steps I should go and make sure I check them all off or stuff will break Um yeah, and that's the command I would mention. I'm still shocked people don't know about this command. It's manage. py check deploy. It's in the docs. You should run it. It doesn't cover all the use cases for you, but it's a great way to cover have you forgotten something before you go into production. I would recommend running it in your CI just as a quick default. So that's the request hardened, but hardening doesn't make anything faster. And some of the work we cram into a request is too slow to be there, which takes us to step seven, which is background workers.

12:51

Speaker 1: So again, you don't need these locally because when something's slow on your laptop, you just wait. But in production, milliseconds matter. Slow tasks just can include email, cleaning up after Stripe charges with the webhooks, and many, many other use cases. The fix is a task queue. Hand the job off. It will respond immediately and do the work in the background. Django 6. 0 added tasks for this. Which is an interface not a worker. Matias gave a talk earlier on building a celery backend for Django Tasks that I hope people watching online go check out So that's one way to add a backend and there are others online and there'll be more in the future. So again, we already have the interface and now we'll get the integrations to go with it. I was going to give a gross simplification of that flow, but honestly you should just watch his talk because he did a much better job.

13:39

Speaker 1: All right, step eight, performance. So again, like security, there's no new boxes here. It's just problems on things we already have. So where do apps get slow? Again, uh Frank and Calvin in the Django and Fast API debate made this point. I think those of us who are senior enough can't say this enough, especially when you go to Python conferences and people say Django is slow and FastAPI is fast, which okay sometimes, but Just because it's in the name doesn't make it so. Like the problem is the database, right? It's not Django. It's not even Python. Do we need to rewrite it in Rust? Like, okay, maybe, but like it's probably your database. So three moves I would suggest in order. Check for N plus one issues. Jacob Walls gave a full talk on this earlier, so I won't dive into that, but that's a known issue with ORMs, and there's new ways to address that.

14:27

Speaker 1: So classically select related prefetch related 6. 1 has model field uh model field fetch modes. Again, Jacob's talk covers that. Second is indexes. Um Django already indexes your foreign keys. You can add the rest in production. It's tempting to just throw indexes around like candy when you're starting out, but they will slow things down. So I would generally recommend just waiting to look at traffic and add them as you need them, even though premature optimization is fun because you launch something, you're like, well, I'm gonna have a million users. Like I better fix that now. Like, yeah, maybe, but probably not. Third is caching. So this is the most powerful one. Compute once, park it in register for memory. The most powerful, also most dangerous. Again, it comes with some costs. There are whole talks on this. Um but basically

15:12

Speaker 1: boils down to now you have two copies of truth and you have to know when to throw away the stale one. So in order, N plus one, indexes, caching. Go as you need. And I've made this mistake for sure. Like really resist the urge to prematurely optimize. Like problems will present themselves. You don't need to go hunting for them right when you Um start out. Step nine, only two more to go, monitoring. So anything that can break will, but how do you know? Again, locally. You'll get a nice error page, things will break, but who knows what your crazy users are going to do on the wild internet with your app. So you want some monitoring Again, this box connects with dash lines, not solid arrows, because it's not part of the request path in any way, but it sits off to the side and watches.

15:57

Speaker 1: I'll tighten up what I was gonna say here, but you should use a tool like Sentry or Datadog or New Relic or Glitch SIP. You can also locally use Django Debug Toolbar. Um you want to know what pages are slow and there are Many ways to do this other than you driving yourself insane, trying to check for them. So the last one I would say is the deployment step. So locally, of course, deploying is just hitting save and it ref refreshes or you can use some cool tools that will auto-refresh for you on the dev server. But in production, there's more or less four steps. So you push the code out from your laptop into GitHub or GitLab or wherever, then you have to run your tests and you should have tests and you can use pre-commit, you can use CI. As an aside, I think we've all seen GitHub actions have some real problems

16:46

Speaker 1: and there's I think a lot that could be done there to not be reliant on something that breaks yet is free. That would be a fun hallway chat with people. Then build where your source becomes a runaful artifact, probably in a container, whether you do that yourself or your platform as a service does it for you. This is where Collect Static will generally run for the static files for you. And then finally the release. So the database schema has to match it, run migrations. Um depending on what deployment option, a platform as a service will do a lot of this for you, and it's probably fine if you don't want to deal with it, but as you're um application grows and you want more control and maybe minimize costs, you will dive further and further down into doing these things yourself. But I'm trying to elevate us up a level from that.

17:31

Speaker 1: And so we're done actually. That's the entire talk in one slide. It's the mental model I have for Django deployments. And every box up there is something that Run Server was quietly doing for you before. And that gap, the distance between one process running on local host and the whole diagram is to me what Django deployment means. So we're back to where we started. Um, why can't we just drag and drop? I've given you 10 reasons why it's a little more complicated than that. Um There's of course many, many, many more once you start diving down the rabbit hole, but as a mental model for why can't the code on my laptop just exist on the internet, uh, I think those 10 are the big ones. Um And yeah, I just think maybe it's just me, but I just had these long

18:18

Speaker 1: deployment checklists that I would go hunt and find on a random blog or somewhere back in the day. Now AI will helpfully give it to you. But if you're so busy head down, you don't pop your head up and think it's not that bad. You know, just like Django, right? I go to Python conferences and people with 20 years of experience and doing AI and all this stuff are afraid of Django. They think Django is too much for them, seriously. And I'm like, you know, if I can do it, you can do it. But it's because they don't have a model of what it does and they also don't know what they need and what they don't. And so I'm really trying to just give you the happy path. Here's the big picture, and then you can get as complicated as you want. So thank you for your attention. I think I'm a little early. You can find me online. I'll put the slides up. And if anyone has questions, I'm happy to take them.

19:04

Speaker 1: This is probably the slide you're interested in, but I would just request I would I'll try not like let's not talk about tooling if we can. Like I know we all want to go, what about this versus this? And if there's no questions, you can ask me on tooling. But yeah. Thank you for your attention.

19:26

Speaker 2: Thank you, Will. Do we have uh we have a question from Peter?

19:32

Speaker 3: Thanks Will. Um I I love that you can just run run server and everything works. And I kind of hate that you need to keep a checklist on your machine that reminds you of all the stuff we do in production. Like do you what do you see are the easiest wins that Django could Maybe change about how what could we do to make it easier? What what do you think like are easy ones there?

19:57

Speaker 1: Yeah, I mean I've had this discussion a lot with Jeff Triplett. I'm sure we've all had it. Like could we Have a local mode, a production mode, could we automatically could we add a little more magic uh to Django? I think so. Um That's a question for the community. I would love to have right now it just all to your point defaults to local, but is there a way you can sort of flip a switch and you get the basic defaults so you can put it on a platform as a service or app pack? Yeah, I think it would help with newcomers who d genuinely if I go to Python conferences people are uh kind of afraid of Django. They just think it's this beast that is unwieldy. Um so yeah, I think it would absolutely help to have another option of a flag or something and start project or we could talk about how we would do it. But yeah, I would like to have a lightweight way to just deploy

20:45

Speaker 1: for sure.

20:47

Speaker 2: Any other questions for our speaker? Oh we got one back and back.

20:57

Speaker 4: Thank you. I was curious if you have any of these checklists, deploy checklists that you Recommend or refer to. Sorry, sorry if this is going into tooling. I don't know.

21:10

Speaker 1: I've been thought about, you know, just my personal one for a long time that I should put up on like learnjingo. com and maybe based on your I I'll finally do that. You know, it va it varies, right? What's curated? I would really start with um the manage deploy dot dot check, I forget, you know, the Django one. That covers a lot. Um but I'd also like to do just My own version of it. Again, I feel this pain. Like I've I have multiple books and like I do these books and then all the questions around deployment because like Heroku changes or fly. io changes or Um and I want to say like it's not my fault, but like I get it that the users feel that way. And so that's why you s that's kind of the the goal of this talk is this stuff won't change that much, but the like little knobs

21:56

Speaker 1: will change. And I think to Pete's question, I think we should do more to make that easier. And I think we can say, hey, this is happy path. This will just get you going on you know, render, railway, whatever, but I think that would help a lot. Um because it it's a big leap from local to production. It's a bigger leap than other web frameworks if you play with them. They they make it a lot. easier. And again, it's the community. We don't want magic, we want batteries, we want explicit, but I I'm biased towards like let's have something that makes it easier for newcomers so they don't need a 20-step checklist. Yeah.

22:31

Speaker 5: Just piggybacking on Pete a little bit. And I think this has been litigated before, but when's when's uh Django Cloud Coming out for like a profit deploy as a service.

22:42

Speaker 1: Well I don't have anything certified. I know some gossip on that. I mean there's there are things people in this room have built that are great for Django. Yeah, I can't I um yeah. I mean there's people in this room and that I know that have made efforts at that point. I think deployment is just really hard to do and it takes a long time and everyone's risk averse and so you need to be there for a long time. Um You know, fast API cloud is great and they're putting a lot of resources to it and they have VC funding. Um but a as Calvin um and Frank said, there is this bias towards people with money and big sites saying, well I need to just you know, go to Amazon or something like that at some point. So I don't think it's quite so easy. Um, but it's probably a good business model.

23:28

Speaker 1: Some people in this room are trying it. They could probably speak to why it's difficult to do well.

23:33

Speaker 2: All right, and here we have our last question.

23:37

Speaker 6: You brought up the AI words, so I'll ask you. Have you found it to be helpful as it made deployment faster for you or is it made things

23:47

Speaker 1: So I'm that's a great question. I'm very basic. Like I don't fiddle with it and it all just works for me, but I do simple stuff. I definitely know people just Have Claude in YOLO mode handling all the infra terraforming Kubernetes and it seems to work pretty well for them. Um so I can't speak from experience, but I know people say that they're doing it and that they think it's great. Um it gives me a little bit of like a yikes, but um you know they're running bigger sites and making it.

24:16

Speaker 6: Because I think that might also help us is like you know, doing the math on like is this actually saving you time and uh you know, is is it doing it well?

24:26

Speaker 1: Yeah. I mean, like me personally, I'm really if if we go back to like the the that diagram of I'm most excited about the ones that are like um Coolify if I have that on there, some of the others that are um uh like a pass service on a VPS. So they provide the layers. They give you a pass-like experience you can bring where you are. I know I think that's really interesting. I suspect that will do really well. So that kind of gets at it.

24:55

Speaker 6: Gotcha.

24:56

Speaker 1: That's a good question. Are you

24:59

Speaker 2: making? And thank you, Will, for your talk and thank you to our audience for their excellent questions. There we go.

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 Will Vincent

More videos from DjangoCon US