How to Containerize a Django Website

MISSING

Jan. 13, 2023

Share with:

At Andes Web Design we build and deploy Django websites and APIs. We also deploy those sites via Kubernetes, which neccesitates containerizing them and having everything work nicely in a cluster environment. This post details some of the things we've learned doing that, with the hopes that it will save you some headaches in your own endeavors. 

Step 0: Create a Python Module

Before actually containerizing a Django site, it is helpful to turn it into an actual Python module. If your site started life via the django-admin startproject command, it is missing essential components which will cause Python's built in build system to fail in its tasks. To do this, you need to add