import os
if os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine'):
    DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', 'HOST':
        '/cloudsql/your-project-id:your-instance-name', 'NAME':
        'django_test', 'USER': 'root'}}
elif os.getenv('SETTINGS_MODE') == 'prod':
    pass
Django on Google App Engine with Cloud SQL in dev environment