I think I may have lied. When I asked the question $100 reward to get a 
simple web2py app runnnig on GAE with Google Cloud SQL 
<https://groups.google.com/forum/#!topic/web2py/SJJBp1dq7VU>, I was either 
incompetent or dishonest in my answer! Masssimo asked me to document the 
process. I have been attempting to recreate it for 2 days, and have failed 
spectacularly. Here's a complete walkthrough.

Installed mysql on my Mac using installer, not homebrew (since MySQL 5.7 
I'm unable to get it to work).
# Log in for first time using temp password. Create root user and user for 
this experiment.
$ mysql -u root -p
mysql> ALTER USER IF EXISTS 'root'@'localhost' IDENTIFIED BY 'foo';
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'foo';
Query OK, 0 rows affected (0.01 sec)
# Create sample database.
mysql> CREATE DATABASE mydatabase;
Query OK, 1 row affected (0.00 sec)
# Give proper privileges to new user.
mysql>  GRANT INSERT ON *.* TO 'testuser'@'localhost' IDENTIFIED BY 'foo';
Query OK, 0 rows affected, 1 warning (0.00 sec)
# Boogie on out
mysql> \Q

Install web2py from source:
$ git clone --recursive https://github.com/web2py/web2py.git
$ cd web2py
# Generate app.yaml and gaehandler.py
$ python web2py.py -G GAE
Your GAE app name: gigcity-1051
# Create the test app
cp -R applications/welcome applications/test
# Add a model that uses Google /cloud SQL
vim applications/test/models/db1.py
# Add this code:
# -*- coding: utf-8 -*-
db = DAL('google:sql://testuser:gigcity-1051/mydatabase')
$  dev_appserver.py ./ --mysql_user=testuser --mysql_password=foo

Open in the browser:
http://localhost:8080/welcome/default/index
>From My Sites, choose the one named test

Result:
Internal error
Ticket issued: 
test/__1.2016-01-02.12-29-59.c707fc5a-2e9c-49fc-afa7-f321cec16352

No ticket available. But error output on the terminal includes:
ERROR:root:The rdbms API (Google Cloud SQL) is not available because the 
MySQLdb library could not be loaded. Please see the SDK documentation for 
installation instructions.

File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/rdbms_mysqldb.py",
 
line 86, in connect
    raise NotImplementedError('Unable to find the MySQLdb library')
NotImplementedError: Unable to find the MySQLdb library


I do have the App Engine SDK installed.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to