January 2015
Intermediate to advanced
198 pages
4h 27m
English
To connect with Cloud SQL instances from our Python code, we use the MySQLdb package, which is a MySQL driver that implements the Python Database API as described in the PEP 249 document. To install the package, we can use pip; from the command line, we issue the following command:
pip install MySQL-python
We don't specify the -t option as we did when installing GCS Client Library in Chapter 3, Storing and Processing Users' Data because the MySQLdb package is included in App Engine Python Runtime Environment on the production servers and we don't need to upload it during deployment. Instead, we list the package in the libraries section of the app.yaml file:
libraries: - name: webapp2 version: "2.5.2" ...
Read now
Unlock full access