[英]How to connect to Postgres on Cloud SQL using the Python Standard Environment on App Engine
I have an app that uses the Python Standard Environment on App Engine. 我有一个在App Engine上使用Python标准环境的应用程序。 I tried, but failed, to find instructions to connect to Postgres on Cloud SQL.
我尝试但未找到连接到Cloud SQL上Postgres的说明。
In the documentation , under "App Engine standard environment to Cloud SQL", I only see instructions for Java. 在文档的 “针对Cloud SQL的App Engine标准环境”下,我仅看到有关Java的说明。
Is it really the case that there is no way to connect to Postgres on Cloud SQL? 确实存在无法连接到Cloud SQL上的Postgres的情况吗?
PostgreSQL is currently only available to GAE Flexible environments and GAE Standard running on Java 8. Python on GAE Standard is not yet supported for PostgreSQL. PostgreSQL当前仅可用于在Java 8上运行的GAE Flexible环境和GAEStandard。PostgreSQL尚不支持GAE Standard上的Python。 See FAQ and supported languages here .
请在此处查看常见问题解答和支持的语言 。
For Python 2.7, you can use pg8000 , but it lacks some features and, in my experience, a little unstable. 对于Python 2.7,可以使用pg8000 ,但是它缺少一些功能,并且根据我的经验,它有点不稳定。
For Python 3.7, you can use psycopg2 . 对于Python 3.7,可以使用psycopg2 。 Seems that the docs examples are for MySQL and not for PostgreSQL, but you can see them here .
似乎该文档示例适用于MySQL,而不适用于PostgreSQL,但您可以在此处查看 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.