【问题标题】:Should I be serving Django with gunicorn when using Google Cloud Platform's Standard Environment? [closed]使用 Google Cloud Platform 的标准环境时,我应该使用 gunicorn 为 Django 服务吗? [关闭]
【发布时间】:2020-05-14 19:02:55
【问题描述】:

app engine quickstart guide for django 没有提及他们的样本 Github Repo 也没有类似 gunicorn 的任何东西。

这里的最佳做法是什么?

还有-

Here is some documentation on the Python3 runtime。让我印象深刻并让我怀疑我是否走在正确轨道上的引述是:

除非您指定入口点,否则不要在您的 requirements.txt 文件中包含 gunicorn。

【问题讨论】:

    标签: django google-app-engine gunicorn


    【解决方案1】:

    根据你也提到的官方文档

    入口点的使用是可选的;

    如果您的应用满足以下条件 条件,App Engine 将使用 gunicorn 作为网络服务器并添加 自动打包到您的 requirements.txt 文件中

    1.您的应用程序目录的根目录包含一个 main.py 文件,其中包含一个 名为 app 的 WSGI 兼容对象。

    2.app.yaml 不包含入口点字段。

    3.您的应用不包含 Pipfile 或 Pipfile.lock 文件。

    您可以在 App Engine 中使用其他网络框架,例如 uwsgi 和 龙卷风

    您可以使用入口点字段来调整应用的性能。但是,如果您不选择入口点,GAE 基础架构将为您处理 gunicorn 任务 (PaaS)。

    【讨论】:

      猜你喜欢
      • 2018-03-29
      • 2020-08-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-11
      • 1970-01-01
      • 2021-02-09
      • 2023-03-22
      相关资源
      最近更新 更多