- To download the Google Appengine Launcher, go to https://cloud.google.com/appengine/docs/standard/python/download and click at the bottom on Download and install the original App Engine SDK for Python, then follow the instructions. Alternatively, you can use the gcloud commands, as described in that page.
- You need to do two things to your web2py installation to make it work for google appengine:
- copy examples/app.example.yaml into app.yaml (in the top directory) and edit it to add your project name, and the version to which you want to deploy;
- copy handlers/gaehandler.py to gaehandler.py (in the top directory).
To connect to a MySQL database from Appengine, if you create a gen-2 database, you have to do as follows.
MySQLdb is a Python module that enables access to a mysql database. It is not enabled by default on Google Appengine, and to enable it, you need to add the following to app.yaml:
libraries: - name: MySQLdb version: "latest" - name: ssl version: 2.7.11
Then, in the DAL command, you have to use a connection string of the form:
"google:MySQLdb://<username>:<password>/<database>?unix_socket=/cloudsql/<project_name>:<region>:<instance_name>"
where:
- region: us-central1, for instance; this is the region of the instance.
- instance_name : the name of the gen-2 instance