Member-only story
Deploying a Django Application to Google App Engine

Google’s docs were helpful, up until I tried to deploy something real…
Today, I successfully deployed a Django application that was working locally to a Google App Engine instance online.
Google’s docs and tutorials (https://cloud.google.com/python/django/appengine) for this process worked well, but they didn’t do a good job of showing you what was going on under the hood with the sample application they had you deploy. When it came time to deploy an independent application, I hit a couple hurdles that I’ll walk through in this post.
As with most of my blog posts, if you find this guide useful, awesome! But I’m mostly writing it as a reference for my future self, because I know I’ll forget some of this stuff when I build another Django app and want to deploy it.
Prerequisites
You’ll need the following to follow along with this guide:
- A Google Cloud Platform account
- A new project in your Google Cloud dashboard
- Billing enabled for GCP account
- Google Cloud SDK installed
- APIs enabled for the project
Structure
This post breaks down into the following sections in order to get an App Engine instance running properly with a Django application. Each section has a clear goal so you know when you’re ready to move on to the next step.
- Make your app run locally
- Change the SQL server to a Cloud SQL instance via a proxy
- Modify settings.py to allow your app to connect to Cloud SQL
- Add other necessary files/requirements to your Django app
- Gather your staticfiles
- Deploy and troubleshoot
1. Make your app run locally
I won’t spend much time here, because this is basic Django stuff and outside the scope of this guide. However, needless to say your app should run locally on your computer.
Need help getting Django running? I’ve made some videos to help you: