简体   繁体   English

GAE 和 AWS RDS PostgreSQL 上的 Django

[英]Django on GAE and AWS RDS PostgreSQL

Is it possible to use an AWS RDS PostgreSQL database with a Django app hosted on Google App Engine standard (Python 3)?是否可以将 AWS RDS PostgreSQL 数据库与托管在 Google App Engine 标准(Python 3)上的 Django 应用程序一起使用?

Currently, any code that tries to connect to the RDS database hangs, but I can connect to the RDS database from my machine.目前,任何尝试连接到 RDS 数据库的代码都会挂起,但我可以从我的机器连接到 RDS 数据库。

I would point out that that from the AWS RDS documentation it's mentioned that you can to allow access to the specific subnet (VPC) with “publicly available” to an IP Range, and you can get the App Engine ranges by performing nslookups as shown here .我要指出的是,从 AWS RDS 文档中提到,您可以允许对 IP 范围“公开可用”的特定子网 (VPC) 进行访问,并且您可以通过执行 nslookups 来获取 App Engine 范围,如下所示. Please keep into consideration that the IP ranges for the App Engine services change in a regular basis.请注意,App Engine 服务的 IP 范围会定期更改。

If you are not using VPCs then you should give a look to this AWS doc .如果您不使用 VPC,那么您应该查看此AWS 文档

I would also suggest testing the connectivity to the GCP resources by using Compute Engine Virtual Machines, this can be performed also by using App Engine Flexible since you are able tossh into the GCE VM instance.我还建议使用 Compute Engine 虚拟机测试与 GCP 资源的连接,这也可以通过使用 App Engine Flexible 来执行,因为您可以将ssh插入 GCE VM 实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM