Book/resource recommendations for understanding deployment in depth?

I managed to deploy a django app using a PaaS.

The problem is I don’t deeply understand what is going on, and it’s already causing errors that I am ill equipped to know how to resolve. Obviously, I attempted to find answers using the PaaS docs and customer support, but so far I feel out of my depth and like these things are written/intended for people who already thoroughly understand deployment which is fine except how do I get from where I am to that level of understanding?

Ideally (if I had a magic wand moment), I want to read a book specifically and entirely about the deployment aspect for django apps and understand:

  • what is going on behind all these related abstractions in detail (i.e. maybe if I understand better how we got from the very first version of how to deploy to what is currently available now as options, config settings and everything else would make more sense because I’d understand the underlying reasoning for the abstractions)
  • what are the options to structure the deployment of a production site and what part of that structure is true no matter how you deploy (PaaS, IaaS, etc.) and what parts of that structure are specific to each style of deployment
  • how people actually troubleshoot a production environment in the real world and how much does the way you troubleshoot change based on how it’s deployed (e.g. are there some parts of troubleshooting that are true regardless of how a django app is deployed?)
  • etc.

I read the django docs related to deployment, and I’ve found Python/Django books that include deployment as one chapter at the end, and the couple of those that I’ve already read essentially provide steps to follow for deployment of that example project’s specific setup and touch on a bit of the above in very high-level ways. And that’s been helpful to start, but now I want the in the weeds foundational knowledge to actually understand what’s happening so that I can have a better chance of figuring out problems as they arise.

Deployment is clearly an area where everything depends on what you choose to do, and I understand there are a lot of branching paths of various options making each production situation very uniquely specific, so I imagine that’s why I’m having trouble finding a resource like this.

But I’ll ask anyway: does anyone have any recommendations for books or other related resources?

Other recommendations also welcome – how did the self-taught among you get a good grasp on deployment?

<opinion>

The best way to learn deployments is to do at least one from the ground-up. Once you’ve done one where you need to configure everything, you can then see what parts of that the provider does for you and the benefits they provide.

This would include installing and configuring parts as needed such as PostgreSQL, nginx, Docker, etc. This also means performing routine maintenance operations such as backups (database and configuration) and component upgrades

You don’t have to do this in a “live” environment either. It would work just as well if you did it in a VirtualBox-type environment or even WSL in Windows. The point is to pull back the curtain and get your hands dirty with those details.

(Yes, I’m aware that that is a painfully mixed metaphor.)
</opinion>

Yes, I agree with this completely. About the best you’re going to be able to do is find good examples of some specific combination of components and configuration options. Even having different versions of things can create differences.

Example - a quick search of the DigitalOcean tutorials shows that they have 11 different pages from a search for [django] Deploy.

Personally, I learned by doing - but when you look at all the parts involved, it was a process spanning more than 10 years. My first real deployments were PHP and Perl systems behind an Apache web server. (2003ish IIRC) Other parts came later.

It’s a large field of weeds!

As pointed out above, every different component you select is going to come with its own quirks. Configuring Apache is vastly different from nginx.

Even just the differences between using mod_wsgi with Apache and using Apache as a reverse proxy to Django running in uwsgi or gunicorn create different configuration problems you may encounter.

So my suggestion would be to either pick one and dive into it - knowing it may not exactly match what your provider is doing in the expectation that the concepts will carry forward, or try and find out the provider’s underlying configurations and attempt to replicate it as much as practical.

And, keep in mind that there are people here to help.