What if you find yourself managing more than one Django-based web site at the same time in production? Do you have to deploy each one of them on a separate server? Or can you manage with just one, saving on hosting expenses? How will you go about the setup in this case, ensuring smooth running of these sites side by side.
For "real" production web site, with medium to heavy traffic, it is probably the best to have a separate server. Even more so, for busier sites you might very well have multiple servers in order to handle the workload. As they say, it is a good problem to have.
On the other hand, you might have a few Django-based sites, which experience very little load. In that case, running more than one of those on the same host makes economical sense. In this post I list some gotchas for such a setup.
If you use the common setup of nginx web server in front of gunicorn container, you need to remember a couple of things:
Caching makes Django web sites faster, when used correctly. If you use caching, you have two options in multi-site setup on the same box:
In general, I always advocate for as much automation in deployment as possible. Ideally you should have a deployment script, which sets up everything via a single command. It can use an existing automation solution, such as ansible, or you might want to roll your own, if you feel like it. But don't do things by hand, this is a sure way to disaster and maintenance headache!
Join the email list to get notified about new posts and other updates