And*_*Geo 2 python google-app-engine mongodb pymongo mongodb-atlas
我正在使用Python 3.7和Flask 1.0.2
我将我的应用程序插入了mongoDB Atlas,在本地一切正常
客户端= pymongo.MongoClient(连接器)
连接器是Atlas给我的标准连接字符串
connector = "mongodb://xxx:<PASSWORD>@xxcluster-shard-00-00-y0phk.gcp.mongodb.net:27017,xxcluster-shard-00-01-y0phk.gcp.mongodb.net:27017,xxxcluster-shard-00-02-y0phk.gcp.mongodb.net:27017/test?ssl=true&replicaSet=xxxCluster-shard-0&authSource=admin&retryWrites=true"
Run Code Online (Sandbox Code Playgroud)
当我将应用程序部署到Google App Engine标准Python3运行时环境时,它不起作用。有人对这个问题有想法吗?
Appengine错误:
pymongo.errors.ServerSelectionTimeoutError:连接已关闭,连接已关闭,连接已关闭“
问题是Ip白名单,因此我通过与gcp的vpc对等连接进行添加。
为了简单起见,我们可以添加0.0.0.0/0以允许从任何地方访问(但是要小心)
。
| 归档时间: |
|
| 查看次数: |
1508 次 |
| 最近记录: |