简体   繁体   English

如何使用App Engine上的Python标准环境连接到Cloud SQL上的Postgres

[英]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.

相关问题 Google App Engine 连接到 Cloud SQL postgres - Google App Engine connect to Cloud SQL postgres App Engine Python,标准环境,使用 time.sleep - App Engine Python, Standard Environment, using time.sleep 无法使用谷歌云日志记录在python3标准环境的谷歌应用引擎中打印相关日志的模块名称和行号 - Unable to print module name and line number for correlated logs in google app engine fo python3 standard environment using google cloud logging 如何通过App Engine标准Python环境在目录中提供文件 - How to serve Files in a Directory from App Engine Standard Python Environment BrokenPipeError - SQLAlchemy - Cloud SQL - App Engine Standard - BrokenPipeError - SQLAlchemy - Cloud SQL - App Engine Standard Google App Engine标准环境(Python + SAML) - Google App Engine Standard Environment (Python + SAML) App Engine 标准 Python 3 环境变量未定义 - App Engine Standard Python 3 environment variables undefined Google App Engine标准环境可以连接到GRPC服务吗? - Can Google App Engine Standard environment connect to a GRPC service? 仅使用pyscopg2从App引擎连接到Cloud SQL Postgres - Connecting to Cloud SQL Postgres from App engine with pyscopg2 only 如何在Google App Engine标准环境(manage.py,…)中运行文件Django / python我的文件 - How to run files my files Django/python in Google App Engine Standard Environment ( manage.py, … )
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM