Multiple Django Apps

How can I run multiple Django apps, each with its own domain, on one GCP Compute Engine (Ubuntu) instance?

This is less a Django question and more of a systems administration/ops question - running multiple apps on a machine is possible, but you have to do what is called “virtual hosting”, where you have a server process (usually Nginx) in front of multiple running Django instances, which routes to the right one based on the hostname.

I’m not going to do a complete guide here, as it’s a long and in-depth process with a lot of potential issues - you can search around for guides, but this guide from DigitalOcean covers most of what I’d want to look at: https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04 (it’s for an older Ubuntu, but most of what is talked about there should be relevant, making sure you use the Python 3 parts).

@andrewgodwin’s suggestion is a good one, especially if your Django apps are completely separate in function.

If the apps are not separate in function, you might want to check out Django’s sites contrib module. The sites module is for handling different domains that ultimately point to the same Django project. The docs explain a possible scenario for using it through an example.

The Django-powered sites LJWorld.com and Lawrence.com are operated by the same news organization – the Lawrence Journal-World newspaper in Lawrence, Kansas. LJWorld.com focuses on news, while Lawrence.com focuses on local entertainment. But sometimes editors want to publish an article on both sites.

(See The “sites” framework | Django documentation | Django)

So if your multiple sites fit into that narrow use case, it might be a good tool to consider.