Unable to access Google Cloud SQL instance in dev_appserver with Django

I recently updated my GAE SDK, and soon after the update, it started to work. I am using Google Cloud SQL in the backend with Django 1.4.3. On my local dev server, it gives the following error:

There are no valid OAuth 2.0 credentials. Before using the Google SQL backend service on dev_appserver, you must first run "manage.py syncdb" and follow the instructions to get the OAuth 2.0 token.

I tried to remove cacert.txt as well as remove google sql authentication from my home directory in order to re-get authentication through running python manage.py syncdb, but that doesn't help.

The same question was raised here with a “fix”:

http://code.google.com/p/googleappengine/issues/detail?id=9006

I tried changing my server.py according to the patch. But no effect.

Any help?

+5
source share
1 answer

I had the same problem and this resolved this for me:

  • copy refresh_token from google oauth.dat json file
  • added to app.yaml:

env_variables: GOOGLE_SQL_OAUTH2_REFRESH_TOKEN: "here the copied token"

+1
source

All Articles