Getting started with Django on Cloud Run

Open in Cloud Shell

This repository is an example of how to run a Django app on Google Cloud Run (fully managed).

The Django application used in this tutorial is the Writing your first Django app, after completing Part 1 and Part 2.

Tutorial

See our Running Django on Cloud Run (fully managed) tutorial for instructions for setting up and deploying this sample application.

docker build --tag cloudrun-django:python .

docker run --rm -p 9090:8080 -e PORT=8080 cloudrun-django:python

# Set an environment variable with your GCP Project ID
export GOOGLE_CLOUD_PROJECT=<PROJECT_ID>

# Submit a build using Google Cloud Build
gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/cloudrun-django

# Deploy to Cloud Run
gcloud run deploy cloudrun-django \
--image gcr.io/${GOOGLE_CLOUD_PROJECT}/cloudrun-django