[web2py] Re: Google Cloud SQL: Unable to connect

2015-10-23 Thread Tom Campbell
Thank you, Sébastien. I indeed had not used MySQLdb in app.yam, nor had I 
included credentials on the tried what you suggested and still get an error 
on the dev_appserver.py command line. Log files say this:

ERROR2015-10-23 21:47:10,581 restricted.py:174] Traceback (most recent 
call last):

  File "/usr/local/web2py/gluon/restricted.py", line 227, in restricted

exec ccode in environment

  File "/usr/local/web2py/applications/todo/models/db.py", line 27, in 


db = DAL('google:sql://gigcity-1051:dbtest/tomsdatabase')

  File "/usr/local/web2py/gluon/packages/dal/pydal/base.py", line 174, in 
__call__

obj = super(MetaDAL, cls).__call__(*args, **kwargs)

  File "/usr/local/web2py/gluon/packages/dal/pydal/base.py", line 473, in 
__init__

"Failure to connect, tried %d times:\n%s" % (attempts, tb)

RuntimeError: Failure to connect, tried 5 times:

Traceback (most recent call last):

  File "/usr/local/web2py/gluon/packages/dal/pydal/base.py", line 446, in 
__init__

self._adapter = ADAPTERS[self._dbname](**kwargs)

  File "/usr/local/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
60, in __call__

obj = super(AdapterMeta, cls).__call__(*args, **kwargs)

  File 
"/usr/local/web2py/gluon/packages/dal/pydal/adapters/google_adapters.py", 
line 59, in __init__

if do_connect: self.reconnect()

  File "/usr/local/web2py/gluon/packages/dal/pydal/connection.py", line 
104, in reconnect

self.connection = f()

  File 
"/usr/local/web2py/gluon/packages/dal/pydal/adapters/google_adapters.py", 
line 57, in connector

return rdbms.connect(**driver_args)

TypeError: connect() got an unexpected keyword argument 'charset'



INFO 2015-10-23 21:47:10,581 gaehandler.py:75]  Request: 
5024.00ms/7.39ms (real time/cpu time)

INFO 2015-10-23 21:47:10,586 module.py:812] default: "GET 
/todo/default/index HTTP/1.1" 500 707

-- 
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.


[web2py] Re: Google Cloud SQL: Unable to connect

2015-10-22 Thread Sébastien
Is it happening locally? Did you install MySQLdb? 

I app.yaml you have to add under "libraries"

- name: MySQLdb
  version: "latest"

Finally you have to add your MySQL credential to dev_appserver.py like:

dev_appserver.py [root folder of web2py] --mysql_user=[mysql user] 
--mysql_password=[mysql password]





On Thursday, 22 October 2015 00:39:16 UTC+2, Tom Campbell wrote:
>
> My app is named todo.
> I want to deploy it to GAE using Google Cloud SQL.
> Connection looks like this:
>
> if not request.env.web2py_runtime_gae:
> db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
> cast=int), check_reserved=['all'])
> else:
> db = DAL('google:sql://gigcity-1951:dbtest/tomsdatabase')
> # etc.
>
> When I try to connect I get an "Internal error":
> https://gigcity-1951.appspot.com/todo/
>
> If I click the ticket link the ticket's missing.
>
> Clue: It's not asking me for my Google credentials.
>

-- 
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.