【问题标题】:Serve a Bottle application from gunicorn on Heroku?在 Heroku 上提供来自 gunicorn 的 Bottle 应用程序?
【发布时间】:2013-07-10 12:14:28
【问题描述】:

Procfile

web: python server.py

server.py

from os import environ
from bottle import app, route, run, static_file

@route('/')
def root():
    return "Hello world!"

if __name__ == '__main__':
    run(server='gunicorn', host='0.0.0.0', port=int(environ.get("PORT", 5000)))

requirements.txt

gunicorn
psycopg2
git+https://github.com/defnull/bottle#egg=bottle

日志文件的相关部分(git push 之后)

heroku[router]: at=error code=H14 desc="No web processes running"

【问题讨论】:

    标签: python heroku bottle gunicorn procfile


    【解决方案1】:

    首先:您确定这些是所有的必要要求吗?

    如果是,您确定您分配了任何测功机吗? heroku ps 的结果是什么? H14 被列为通常是由于没有设置 dynos 来运行您的应用程序造成的。

    您可以通过heroku ps:scale web=1 将其设置为使用一个网络测功机。

    【讨论】:

    • 我之前在这个应用程序上通过 gunicorn 运行 web2py。我刚刚删除了所有这些文件并将其替换为上述文件。 heroku ps 什么也没告诉我。 heroku run python server.py 工作,将其托管在随机端口上(并将其附加到我的控制台)。
    • 试试heroku ps:scale web=1,问题可能会自行解决。
    • 这很奇怪,谢谢;最后一个命令有效。编辑你的答案,我也会投票赞成:)
    • 最后一个命令是解决我建议您可能在问题中遇到的问题。你知道 Heroku 是如何工作的吗?
    猜你喜欢
    • 2016-04-15
    • 1970-01-01
    • 2018-04-01
    • 2015-06-04
    • 1970-01-01
    • 1970-01-01
    • 2013-07-03
    • 2021-11-25
    • 2020-09-16
    相关资源
    最近更新 更多