I am trying to create an application with Django on GAE and CloudSQL as the db.
I used this google developers link and this link for setting up the dev-environment. I am not able to connect to local mysql db.
Here is the DATABASE setting which I am trying to use.
if (os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine') or
os.getenv('SETTINGS_MODE') == 'prod'):
DATABASES = {
'default': {
'ENGINE': 'google.appengine.ext.django.backends.rdbms',
'INSTANCE': 'instance:appid',
'NAME': 'database_name',
}
}
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'USER': 'root',
'PASSWORD': '',
'HOST': 'localhost',
'NAME': 'database_name',
}
}
My app is working perfectly on production GAE, but when I try to start the app on dev env, I am getting this error
File "/home/sandeep/Downloads/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 635, in __init__
raise IOError(errno.EACCES, 'file not accessible', filename)
IOError: [Errno 13] file not accessible: '/usr/local/lib/python2.7/site-packages/MySQL_python-1.2.4-py2.7-linux-x86_64.egg'
Complete stack-trace at http://pastebin.com/ZXHv0FPQ
I had installed the "python-mysql" by downloading the source and running "python setup.py install"
Edit 1
I have also tried adding the MySQLdb to the library.
- name: MySQLdb
version: "latest"
Got this error
the library "MySQLdb" is not supported
in "/home/sandeep/development/UploadImage/src/app.yaml", line 14, column 1
EDIT 2
Django syncdb is working fine with this settings and django is able to create the tables for me.But,when I try to run via "dev_appserver.py", then I got the above stacktrace.
I am able to access the cloudSQL in dev environment.