Python 不适用于 heroku

Python doesn't work with heroku

我正在使用 api ai 来制作天气机器人,我正在制作 webhook。但它不适用于 heroku。

日志:

2017-02-12T01:04:09.580619+00:00 heroku[slug-compiler]: Slug compilation started
2017-02-12T01:04:09.580628+00:00 heroku[slug-compiler]: Slug compilation finished
2017-02-12T01:04:09.431329+00:00 app[api]: Deploy f5b127a by user ntrung03@gmail.com
2017-02-12T01:04:09.431329+00:00 app[api]: Release v8 created by user ntrung03@gmail.com
2017-02-12T01:04:09.768517+00:00 app[api]: Release v8 created by user ntrung03@gmail.com
2017-02-12T01:04:55.382953+00:00 heroku[slug-compiler]: Slug compilation started
2017-02-12T01:04:55.382960+00:00 heroku[slug-compiler]: Slug compilation finished
2017-02-12T01:04:55.273050+00:00 app[api]: Deploy f5b127a by user ntrung03@gmail.com
2017-02-12T01:04:55.273050+00:00 app[api]: Release v9 created by user ntrung03@gmail.com
2017-02-12T01:04:55.517592+00:00 app[api]: Release v9 created by user ntrung03@gmail.com
2017-02-12T01:05:02.283592+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/webhook" host=botmia.herokuapp.com request_id=cf6fc4f6-fd84-415b-b2de-0c69e140ef5b fwd="54.198.43.155" dyno= connect= service= status=503 bytes=
2017-02-12T01:08:56.636508+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/webhook" host=botmia.herokuapp.com request_id=2e1b3ba4-c495-431e-8695-7dd742258201 fwd="54.198.43.155" dyno= connect= service= status=503 bytes=
2017-02-12T01:12:28.027455+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=botmia.herokuapp.com request_id=23238026-ba99-45da-a0d4-94b426e8dbb8 fwd="117.5.143.247" dyno= connect= service= status=503 bytes=
2017-02-12T01:12:29.548164+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=botmia.herokuapp.com request_id=95a8d5b9-639f-405e-a83e-a4603ab44f1c fwd="117.5.143.247" dyno= connect= service= status=503 bytes=

Host on Heroku

Source

但不起作用 感谢大家对我的帮助。我是 Api.ai heroku & python

的新手

从你的错误日志来看,你似乎有一个代码 H14,这意味着你还没有启动你的网络测功机 (https://devcenter.heroku.com/articles/error-codes#h14-no-web-dynos-running)。您可以从终端通过 运行ning heroku ps:scale web=1 启动测功机(假设您安装了 heroku 命令行工具)。您需要至少 1 个 dyno 运行ning 才能让您的网站正常运行。

我能够在新的 heroku 站点上 运行 成功获取你的应用程序,在我机器上的应用程序目录中使用以下命令 运行:

$ git clone https://github.com/TrungNguyen1909/BotMia
$ cd BotMia
$ heroku create
$ git push heroku master

这样做之后,向 /webhook 发出 post 请求成功访问该端点,如您在日志中所见:

2017-02-12T01:53:12.721050+00:00 heroku[router]: at=info method=POST path="/webhook" host=MY_HOST request_id=REQ_ID fwd="IP" dyno=web.1 connect=1ms service=4ms status=500 bytes=452

对于 Heroku,您在 Procfile 中描述了您的 dyno 配置,它应该位于项目的根目录中。

参见:https://devcenter.heroku.com/articles/procfile