Google Cloud Platform

Introduction

This guide will help you add sqlcommenter to your Django applications running on Google Cloud Platform (GCP)

Requirements

Steps Resource
Django on GCP https://cloud.google.com/python/django/
google-cloud-sqlcommenter https://pypi.org/project/google-cloud-sqlcommenter
Django 2.X https://docs.djangoproject.com/en/stable/faq/install
Python 3.X https://www.python.org/downloads/

Addition to your code

Firstly, please install google-cloud-sqlcommenter.

For any Django deployment, we can just edit our settings.py file and update the MIDDLEWARE section as per:

MIDDLEWARE = [
  'google.cloud.sqlcommenter.django.middleware.SqlCommenter',
  ...
]

References

Resource URL
Running Django on GCP https://cloud.google.com/python/django/
Installing Django middleware /python/django#installation