You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/_index.md
+25-8Lines changed: 25 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,19 @@ title: Deploy Django on Google Cloud C4A (Arm-based Axion VMs)
3
3
4
4
minutes_to_complete: 30
5
5
6
-
who_is_this_for: This Learning Path is for software developers deploying and optimizing Django-based web applications on Arm64 Linux environments, specifically using Google Cloud C4A virtual machines powered by Axion processors.
6
+
who_is_this_for: This Learning Path is designed for DevOps engineers and software developers who want to deploy, operate, and benchmark a production-grade Django REST API on Google Kubernetes Engine (GKE) running on Arm64 Axion processors, integrated with managed Google Cloud data services.
7
7
8
8
learning_objectives:
9
9
- Provision an Arm-based SUSE Linux Enterprise Server (SLES) virtual machine on Google Cloud (C4A with Axion processors)
10
-
- Install Django on a SUSE Arm64 (C4A) instance
11
-
- Verify Django functionality by running the development server and accessing the default welcome page on the Arm64 VM
12
-
- Measure Django application performance by benchmarking request handling throughput and latency using the official ApacheBench (ab) tool with Gunicorn on Arm64 (aarch64)
10
+
- Provision Google Axion (Arm64) compute using GKE node pools
11
+
- Package a Django REST API into an Arm-native Docker container
12
+
- Push container images to Google Artifact Registry
13
+
- Deploy Django on GKE using Kubernetes manifests (Deployment, Service, ConfigMap, Secrets)
14
+
- Integrate Django with Cloud SQL (PostgreSQL) over private IP
15
+
- Integrate Django with Memorystore (Redis) for caching and sessions
16
+
- Expose Django using a Kubernetes LoadBalancer
17
+
- Validate application connectivity to PostgreSQL and Redis
18
+
- Measure throughput and p95 latency using ApacheBench against Gunicorn on Arm
13
19
14
20
prerequisites:
15
21
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/background.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,6 @@ To learn more, visit the [Django website](https://www.djangoproject.com/) and ex
31
31
32
32
You now understand the capabilities of Google Axion C4A Arm-based VMs and why Django is an excellent choice for building web applications on Arm infrastructure. The combination provides a cost-effective, high-performance platform for deploying Python web applications at scale.
33
33
34
-
In the next sections, you'll provision your own Arm-based VM on Google Cloud, install Django, and benchmark your application's performance. You're ready to start building!
34
+
In the next sections, you'll provision your own Arm-based VM on Google Cloud, install Django, and benchmark your application's performance.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/baseline.md
+18-27Lines changed: 18 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,22 +8,11 @@ layout: learningpathall
8
8
9
9
## Verify Django is working on your Arm-based VM
10
10
11
-
In this section, you'll confirm that Django is installed correctly and can serve web requests on your Google Cloud C4A VM. You'll create a Django project, run the development server, and access it from your browser. This hands-on verification ensures your environment is ready for development and testing.
12
-
13
-
By the end of this section, you'll have:
14
-
- Created a Django project with proper directory structure
15
-
- Configured Django to accept requests from your VM's external IP
16
-
- Run the development server and accessed it from your browser
17
-
- Built a simple Django app with custom routing and views
18
-
- Verified that Django can handle HTTP requests and render responses
19
-
20
-
Let's get started!
21
-
22
-
## Create and test a basic Django project
11
+
In this section, you'll confirm that Django is installed correctly and can serve web requests on your Google Cloud C4A VM. You'll create a Django project, run the development server, and access it from your browser.
23
12
24
13
Run the following command to create a new Django project named `myproject`:
25
14
26
-
```console
15
+
```bash
27
16
django-admin startproject myproject
28
17
cd myproject
29
18
```
@@ -46,7 +35,7 @@ The `manage.py` file is Django's command-line utility for project management. Th
46
35
47
36
Set up your project's database by running migrations, which create the required tables for Django's built-in apps:
48
37
49
-
```console
38
+
```bash
50
39
python3 manage.py migrate
51
40
```
52
41
@@ -58,27 +47,29 @@ Before starting the Django development server, you must configure your `ALLOWED_
58
47
59
48
Navigate to your project settings directory:
60
49
61
-
```console
50
+
```bash
62
51
cd~/myproject/myproject/
63
52
```
64
53
65
54
Open `settings.py` using a text editor:
66
55
67
-
```console
56
+
```bash
68
57
edit myproject/settings.py
69
58
```
70
59
71
-
- Locate the `ALLOWED_HOSTS` Line
72
-
Inside the file, find the following line:
60
+
- Locate the ALLOWED_HOSTS line
61
+
62
+
Inside the file, find the following line:
73
63
74
64
```python
75
65
ALLOWED_HOSTS= []
76
66
```
77
67
78
68
Update it to allow your VM's external IP address:
79
69
80
-
- Allow All Hosts (for Testing Only)
81
-
To make your Django app accessible from your VM’s external IP address, update it to:
70
+
- Allow all hosts (for testing only)
71
+
72
+
To make your Django app accessible from your VM's external IP address, update it to:
Now that you've configured `ALLOWED_HOSTS`, start the development server:
94
85
95
-
```console
86
+
```bash
96
87
python3 manage.py runserver 0.0.0.0:8000
97
88
```
98
89
@@ -110,7 +101,7 @@ Replace `<YOUR_VM_EXTERNAL_IP>` with the public IP address of your GCP VM.
110
101
111
102
You should see the Django welcome page with the message "The install worked successfully!":
112
103
113
-

104
+

114
105
115
106
## Build a simple Django app with custom routing
116
107
@@ -124,7 +115,7 @@ Press **Ctrl + C** in your terminal to stop the Django development server.
124
115
125
116
Within your Django project directory, create a new app named `hello`:
126
117
127
-
```console
118
+
```bash
128
119
python3 manage.py startapp hello
129
120
```
130
121
@@ -148,7 +139,7 @@ Edit `hello/views.py` and replace the entire file with:
148
139
from django.http import HttpResponse
149
140
150
141
defhome(request):
151
-
return HttpResponse("<h1>Hello, Django on Arm!</h1>")
142
+
return HttpResponse("<h1>Hello, Django on GCP SUSE ARM64!</h1>")
152
143
```
153
144
154
145
This simple view function returns a basic HTML message as an HTTP response.

228
+

238
229
239
230
## Summary and what's next
240
231
241
-
You've successfully verified that Django is installed and working on your Arm-based VM. Your application can serve web requests, handle routing, and render custom views. Great job, you're ready to benchmark your Django application!
232
+
You've successfully verified that Django is installed and working on your Arm-based VM. Your application can serve web requests, handle routing, and render custom views.
0 commit comments