7
The ‘Django Support’ documentation hints at the solution, but doesn’t make it explicit:
Since the standard django.db.backends.mysql backend uses MySQLdb internally, app.yaml must reference MySQLdb in the list of libraries.
Adding the following to app.yaml
seems to fix the ImportError:
libraries:
- name: MySQLdb
version: "latest"
Note that MySQLdb is not currently included in the list of available third party libraries. I tried it on a whim and it seems to have fixed the issue for me, YMMV.enter link description here
2
As the Cloud SQL docs clearly state, you should be using ''google.appengine.ext.django.backends.rdbms'
as your database engine setting.
- [Django]-A pip install doesn't add anything to pipFile or pipFile.lock
- [Django]-How to convert the django web application into the desktop application
- [Django]-Django-pyodbc SQL Server/freetds server connection problems on linux
- [Django]-Changing models in django results in broken database?
- [Django]-Mercurial: Exclude django settings.py after intitial commit
0
If it’s not working after adding the following to your app.yaml:
libraries:
- name: MySQLdb
version: "latest"
…then take the following steps:
- Ensure MySQLdb is installed
pip install mysql-python
on Mac - Ensure the GAE devserver is pointing to your virtualenv/pip’d python 2.7 installation vs. Mac/*nix’s default version as pip may not have installed it there. I resolved
Can't find module: MySQLdb
by updating the GAE devserver to use:/usr/local/bin/python2.7
e.g. in GAE devserver preferences for Python Path
Note: the preferences can be accessed through the application menus:
- If you’re using Windows: look under
File > Preferences...
- If you’re using Mac, look under
GoogleAppengineLauncher > Preferences...
- [Django]-Django + celery – why my periodic task in not running?
- [Django]-DRF: Always apply default permission class
- [Django]-How to clear some warning messages using Django and Python
- [Django]-How to use python-social-auth with google only?