Create and deploy a basic Django Web application on Google Cloud with Bitnami Django.
Contributed by the Google Cloud community. Not official Google documentation.
This tutorial demonstrates how to create and deploy a basic "hello world" Django web app on Google Cloud in just a few minutes using Bitnami Django.
Install Bitnami Django on a Compute Engine instance.
Create a "hello world" Django application.
Serve the application with Apache.
Configure a database (optional).
Before you begin
Before starting this tutorial, ensure that you have set up a Google Cloud project. You can use an existing project or create a new project.
The default configuration allows you to run a low-traffic web app powered by Django using an f1-micro instance with a standard 10 GB persistent disk. You can customize the configuration when deploying this solution or change it later, although the default configuration is fine for the purposes of this tutorial.
Estimated cost for the above default configuration is $4.28 per month, based on 30-day, 24 hours per day usage in the Central US region. Sustained use discount is included.
Use the pricing calculator to generate a cost estimate based on your projected usage. New Google Cloud customers may be eligible for a free trial.
Deploy Bitnami Django on a Compute Engine instance
Deploy Bitnami Django on a Compute Engine instance:
Search for "django certified by bitnami" and select the resulting Django Certified by Bitnami template.
Review the information and cost. Click Launch on Compute Engine to proceed.
Review the default zone, machine type, boot disk size and other parameters and modify as needed. Ensure that the Allow HTTP traffic and
Allow HTTPS traffic boxes are checked in the firewall configuration. Click Deploy to proceed with the deployment.
The Cloud Launcher deploys Bitnami Django on a new Compute Engine instance. You can monitor the progress of the deployment from the Deployment Manager. After deployment is complete, note the public IP address of the instance and the password for the MySQL and PostgreSQL databases.
Create a "hello world" Django application
Login to the deployed instance and create a simple Django application:
After you have finished this tutorial, you can remove the resources you created on Google Cloud so you aren't billed for them any longer. You can delete the resources individually, or delete the entire project.
Deleting the project
Visit the Resource Manager. Select the project you used for this tutorial and click Delete. Once deleted, you cannot reuse the project ID.
Deleting individual resources
Navigate to the Deployment Manager. Find the deployment you used for this tutorial and click Delete.
Learn more about the topics discussed in this tutorial: