【问题标题】:Why isn't my python flask website working on heroku?为什么我的 python 烧瓶网站不能在 heroku 上运行?
【发布时间】:2021-09-12 18:02:20
【问题描述】:

所以我已经将我使用 html、css、flask、python 和 javascript 制作的网站上传到了 heroku。但它给了我这个错误信息:

06-30T14:23:51.105143+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=iptutorial-api-heroku.herokuapp.com request_id=fbf325a2-66d3-4a54-8a8a-b6c32769d19a fwd="86.190.136.60" dyno= connect= service= status=503 bytes= protocol=https

那么这是什么意思?我该如何解决?我已经制作了 procfile 并将其放入其中:

网站:gunicorn iptutorial:app 发布:python manage.py db upgrade

我还为 python 安装了 gunicorn 和 buildpacks。那么为什么它不起作用呢??

【问题讨论】:

    标签: python flask heroku web-deployment


    【解决方案1】:

    确保您有一个声明您的应用程序是 Web 应用程序的 procfile。

    例如,您的 Procfile 应该如下所示:

    web: gunicorn run:app
    

    其中 run 是运行应用程序的模块的名称。

    【讨论】:

    • 在这种情况下,共享运行您的应用程序的模块。让我们看看吧。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-07
    • 2021-06-24
    • 2019-04-01
    • 1970-01-01
    • 2022-01-19
    相关资源
    最近更新 更多