Abd*_*man 4 python django google-compute-engine django-deployment google-cloud-platform
我已经使用 Django 1.10.5 和 python 3.6 创建了一个项目,现在我需要在谷歌计算引擎上部署这个项目。我已经在谷歌上搜索了很多,但找不到任何明确的指南来在计算引擎上部署我的 Django 应用程序。
我尝试过的:
python manage.py runserver
从我的目录运行我的应用程序时,它说:Django 版本 1.10.5,使用设置 'brain.settings'
启动开发服务器于
http://127.0.0.1:8000/
使用 CONTROL-C 退出服务器。
http://127.0.0.1:8000/
不加载任何页面。如何在 Google 计算引擎上部署 Django 1.10 和 Python 3.6 应用程序?请帮帮我!提前致谢!
您所需要做的就是在 Google Cloud Platform (GCP) 上为TCP:8000
.
为此,只需连接到您的GCP:控制台防火墙规则并添加新规则即可。
另外,请务必启动 Django 以侦听公共接口,并使用公共 IP 进行访问。
python manage.py runserver 0.0.0.0:8000
Run Code Online (Sandbox Code Playgroud)