【发布时间】:2019-02-28 08:17:56
【问题描述】:
我知道有人问过这个问题,但我已经阅读了此处显示的内容,但我仍然没有看到问题出在哪里,因为我仍然无法在 Django 2.1.1 应用程序中发布Google App Engine 中的 Python37 环境:
Python 3 Django on App Engine Standard: App Fails to Start
总的来说,我正在尝试使用以下方法发布一个简单的应用引擎应用:
gcloud app deploy
我的应用程序在本地工作,但是当我发布时,它可以顺利通过,但我很烦:
500 服务器错误消息
当我查看 Google 中的日志时,我得到了与许多其他人一样的错误:
ModuleNotFoundError: 没有名为“main”的模块
这是我的相关目录结构
项目门户
-
项目门户
init.py
settings.py
urls.py
wsgi.py
main.py
app.yaml
requirements.txt
我的 app.yaml 文件
runtime: python37
entrypoint: gunicorn -b :$PORT project_portal.wsgi
env: standard
handlers:
- url: .*
secure: always
redirect_http_response_code: 301
script: project_portal.wsgi.application
我的 project_portal/wsgi.py 文件
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project_portal.settings')
application = get_wsgi_application()
来自项目根目录中的 main.py
from project_portal.wsgi import application
来自 requirements.txt
django == 2.1.1
【问题讨论】:
标签: python django google-app-engine python-3.7