Member-only story

Deploying a Django Application to Google App Engine

Bennett Garner
9 min readNov 19, 2018

--

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:

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.

  1. Make your app run locally
  2. Change the SQL server to a Cloud SQL instance via a proxy
  3. Modify settings.py to allow your app to connect to Cloud SQL
  4. Add other necessary files/requirements to your Django app
  5. Gather your staticfiles
  6. 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:

--

--

Bennett Garner
Bennett Garner

Written by Bennett Garner

DeveloperPurpose.com — Build a coding career with meaning and purpose 💻 Top writer in technology ✍️

Responses (28)

Write a response