Introduction
Get started with Django on Google Axion C4A
Configure firewall rules for Django on Google Cloud
Create a Google Axion C4A Arm virtual machine on GCP
Install Django on your Arm-based VM
Verify Django installation and run the development server
Deploy Django on GKE Axion with managed data services
Build a Django REST API with PostgreSQL and Redis
Containerize and deploy Django on Axion GKE
Benchmark Django application performance on Arm
Next Steps
After connecting to your SUSE Linux Enterprise Server (SLES) VM using SSH, you’ll install the Google Cloud CLI, update your system, install Python 3.11, and set up a virtual environment for your Django project.
Update the system packages and install dependencies:
sudo zypper refresh
sudo zypper update -y
sudo zypper install -y curl git tar gzip
Install Python 3.11:
sudo zypper install -y python311
which python3.11
Verify that Python and pip are installed correctly:
python3.11 --version
pip3.11 --version
The output is similar to:
Python 3.11.10
pip 22.3.1 from /usr/lib/python3.11/site-packages/pip (python 3.11)
The Google Cloud CLI is required to authenticate with GCP and allow your Django application VM to interact with Google Cloud services such as GKE, Cloud SQL, Artifact Registry, Memorystore, and to build, deploy, and operate the Django platform.
Download and extract the Google Cloud SDK:
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-460.0.0-linux-arm.tar.gz
tar -xvf google-cloud-sdk-460.0.0-linux-arm.tar.gz
Install gcloud:
./google-cloud-sdk/install.sh
After installation completes, exit and reconnect to apply the PATH changes:
exit
Authenticate and configure the Google Cloud CLI:
gcloud init
During initialization, select Login with a new account. You’ll be prompted to authenticate using your browser and receive an auth code to copy back. Select the project you want to use and choose default settings when unsure.
gcloud auth list
The output is similar to:
Credentialed Accounts
ACTIVE ACCOUNT
* <PROJECT_NUMBER>-compute@developer.gserviceaccount.com
Create a dedicated directory for your Django project and set up a Python virtual environment to isolate your project’s dependencies:
mkdir ~/myproject && cd ~/myproject
python3.11 -m venv venv
source venv/bin/activate
The python3.11 -m venv venv command creates an isolated Python environment named venv inside your project folder. Running source venv/bin/activate activates this environment.
Once activated, your command prompt displays (venv) at the beginning, indicating that you’re working inside an isolated Python environment.
With your virtual environment active, upgrade pip to the latest version:
python3 -m pip install --upgrade pip
Now install Django and additional useful packages for web development:
python3 -m pip install django gunicorn
This installs:
Verify that Django is installed correctly:
django-admin --version
The output is similar to:
5.2.10
In this section, you installed:
Next, you’ll verify Django is working by creating a basic project and running the development server.