Rosanlal Behera Rosanlal Behera - 6 months ago 37
MySQL Question

Google App Engine, Django: Tables are not made in Google cloud SQL after deployment

I am deploying a website with django-backend on google app engine. I followed their tutorial. I have run the website on my local server using MySQL and it runs perfectly.
When deploy it on Google App Engine it gives me the following error:

ProgrammingError "Table 'clouddatabasename'.'appname'_'modelname' doesn't exist"

Here is my app.yaml:

# [START django_app]
runtime: python27
api_version: 1
threadsafe: yes

- url: /static
static_dir: static/
- url: .*
script: wt.wsgi.application

# Only pure Python libraries can be vendored
# Python libraries that use C extensions can
# only be included if they are part of the App Engine SDK
# Using Third Party Libraries:
- name: MySQLdb
version: 1.2.5
- name: django
version: "1.11"

CLOUDSQL_CONNECTION_NAME: 'copied perfectly from google cloud sql instance'

# [END django_app]

# Google App Engine limits application deployments to 10,000 uploaded files per
# version. The skip_files section allows us to skip virtual environment files
# to meet this requirement. The first 5 are the default regular expressions to
# skip, while the last one is for all env/ files.
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
- ^env/.*$

Here is my

if os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine'):
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'database_name',
'USER': 'user_name',
'PASSWORD': 'password',
'HOST': '/cloudsql/copied perfectly from google cloud sql instance',


'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': '',
'PORT': '3306',
'NAME': 'database_name',
'USER': 'username',
'PASSWORD': 'password',

Kindly help me. I don't know why my models/tables are not available on Google App engine. Thanks in advance!

Joe Joe
Answer Source

You said you followed the steps. When you made and ran your migrations, did you have the Cloud SQL Proxy running? If it wasn't running or was not configured properly, that would explain why your migrations ran fine in your local database but were not applied in the Cloud database.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download