Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/323.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 应用程序引擎标准上的Postgres-插入时出错_Python_Postgresql_Google App Engine - Fatal编程技术网

Python 应用程序引擎标准上的Postgres-插入时出错

Python 应用程序引擎标准上的Postgres-插入时出错,python,postgresql,google-app-engine,Python,Postgresql,Google App Engine,appenginestandard只支持python2,库必须是纯python,所以我使用SQLAlchemy和pg8000(纯python而不是psycopg2)连接到一个Postgres实例。连接没有任何问题,但当尝试插入时,我得到以下错误,我不完全理解: <type 'memoryview'> has type <type 'memoryview'>, but expected one of: str, unicode 任何帮助都将不胜感激——或者如果您成功地将P

appenginestandard只支持python2,库必须是纯python,所以我使用SQLAlchemy和pg8000(纯python而不是psycopg2)连接到一个Postgres实例。连接没有任何问题,但当尝试插入时,我得到以下错误,我不完全理解:

<type 'memoryview'> has type <type 'memoryview'>, but expected one of: str, unicode

任何帮助都将不胜感激——或者如果您成功地将Postgres连接到App Engine Standard,我愿意接受除使用pg8000之外的任何替代解决方案。

您可能需要在db连接中添加
ssl=True

pg8000.connect(ssl=True, **config)
或者在炼金术中:

create_engine('postgresql+pg8000://user:pass@hostname/dbname', connect_args={'ssl': True}, echo=True)
create_engine('postgresql+pg8000://user:pass@hostname/dbname', connect_args={'ssl': True}, echo=True)