heroku不能使用我的python脚本

heroku不能使用我的python脚本

本文介绍了heroku不能使用我的python脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的python和烧瓶。
烧瓶的文件说,你可以将你的应用程序部署到heroku公众访问。所以我转向heroku网站。我一步一步按照入门指南。我成功部署了应用程序,但是当我使用,它表示有错误。

错误信息是:

 应用程序发生错误,您的页面无法投放。请稍后重试。 

如果您是应用程序所有者,请查看您的日志以获取详细信息。

我试过heroku日志命令:

2015-02-06T05:05:23.598482 + 00:00 heroku [api]:发布v2由[email protected]创建
2015-02-06T05:05:23.598482 + 00:00 heroku [api]:通过[email protected]启用Logplex
2015-02-06T05:43:45.975680 + 00:00 heroku [api]:通过[email protected]部署6c41484
2015-02 -06T05:43:45.975680 + 00:00 heroku [api]:发布v3由[email protected]创建
2015-02-06T05:45:21.762316 + 00:00 heroku [router]:at = error code = H14 desc =没有Web进程正在运行method = GET path =/host = mighty-falls-2323.herokuapp.com request_id = a2351725-38cb-4480-a97a-b9cf84b1c8ec fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-06T05:45:24.285661 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path = /favicon.icohost = mighty-falls-2323.herokuapp.com request_id = 80d64b3a-3da7-4836-a653-0040b43acd0a fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-06T05:45:58.722807 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/host = mighty-falls- 2323.herokuapp.com request_id = 5864f9d0-f4cb-438d-acc6-74c1afb05188 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-06T05:46:20.066306 + 00: 00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ testhost = mighty-falls-2323.herokuapp.com request_id = 1b62f73b-3240-4428-bc77- 112801685486 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-06T05:47:57.279689 + 00:00 heroku [api]:部署6c41484 by [email protected]
2015-02-06T05:47:57.279689 + 00:00 heroku [api]:发布v4由[email protected]创建
2015-02-06T06:02:22.868450 + 00:00 heroku [api ]:发布v5由[email protected]创建
2015-02-06T06:02:22.868450 + 00:00 heroku [api]:部署38003ed由[email protected]
2015-02-06T06 :02:41.211691 + 00:00 heroku [router]:at = error code = H14 desc =没有web pro chenses runningmethod = GET path =/host = mighty-falls-2323.herokuapp.com request_id = 0be3ab2e-e3d3-4186-8ae2-fddcd5919f11 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-06T06:03:12.755692 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ testhost = mighty-下载地址:http://www.facebook.com/dbdcb909-ee4a-4c37-dead0-a2f38d9bad3e fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-06T06:03:58.407684+ 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ testhost = mighty-falls-2323.herokuapp.com request_id = 52d528be-0e19-491d- b80f-a6ed468a687c fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-06T06:08:41.991908 + 00:00 heroku [api]:通过kelvintgx @ yahoo部署9d0211e。 com
2015-02-06T06:08:41.991908 + 00:00 heroku [api]:发布v6由[email protected]创建
2015-02-06T06:09:11.138002 + 00:00 heroku [路由器]:在=错误代码= H14 desc =不,我们b进程正在运行method = POST path =/ testhost = mighty-falls-2323.herokuapp.com request_id = c2164d36-0c85-43fb-87d0-d637b011116e fwd =223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-06T06:09:37.362330 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/host = mighty -falls-2323.herokuapp.com request_id = 49c04057-1a7b-432d-a8a8-7d5687b717d1 fwd =223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-06T06:10:15.040200 +00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ index.py/testhost = mighty-falls-2323.herokuapp.com request_id = ef7a49b4 dyno = connect = service = status = 503 bytes =
2015-02-06T08:03:09.470102 + 00:00 heroku [api]:v7发布v7由[email protected]创建
2015-02-06T08:03:09.470102 + 00:00 heroku [api]:部署9d0211e by [email protected]
2015-02-06T08:03:38.874551 +00:00 heroku [路由器]:at =错误代码= H 14 desc =没有web进程运行方法= GET路径=/主机= mighty-falls-2323.herokuapp.com request_id = 3e7ebf43-d55f-4831-98ee-3758957c6110 fwd =223.66.227.40dyno =连接= service = status = 503 bytes =
2015-02-06T10:21:31.070674 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/ host = mighty-falls-2323.herokuapp.com request_id = 8c2a7f5b-3382-4685-9e50-8415fbfc8703 fwd =223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-06T10 :25:42.879279 + 00:00 heroku [api]:用命令启动进程 false&&自动诊断由HEROKU支持运行; cat procfile by [email protected]
2015-02-06T10:25:46.887330 + 00:00 heroku [run.4361]:等待客户
2015-02-06T10: 25:46.921078 + 00:00 heroku [run.4361]:用命令 false&&自动诊断由HEROKU支持运行; cat procfile
2015-02-06T10:25:48.553909 + 00:00 heroku [api]:用命令启动进程 false&&自动诊断由HEROKU支持运行; cat requirements.txt by [email protected]
2015-02-06T10:25:47.174906 + 00:00 heroku [run.4361]:状态从开始变为
2015-02-06T10:25:49.052088 + 00:00 heroku [run.4361]:进程退出状态0
2015-02-06T10:25:49.061559 + 00:00 heroku [run.4361]:状态变更完成
2015-02-06T10:25:55.154435 + 00:00 heroku [run.5301]:等待客户
2015-02-06T10:25:55.187005 + 00:00 heroku [运行.5301]:用命令 false&&自动诊断由HEROKU支持运行; cat requirements.txt
2015-02-06T10:25:55.608338 + 00:00 heroku [run.5301]:状态从开始变为
2015-02-06T10: 25:57.225198 + 00:00 heroku [run.5301]:进程退出状态0
2015-02-06T10:25:57.237272 + 00:00 heroku [run.5301]:状态由up改为
2015-02-06T10:41:02.655049 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/host = mighty-falls-2323 .herokuapp.com request_id = 88ad749c-b3c0-41da-8522-052c25beaa58 fwd =82.227.198.77dyno = connect = service = status = 503 bytes =
2015-02-06T10:41:02.986494 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/ favicon.icohost = mighty-falls-2323.herokuapp.com request_id = 3cb538b8-7020-49c5-8d5f -4752ed41bf17 fwd =82.227.198.77dyno = connect = service = status = 503 bytes =
2015-02-06T10:41:14.129885 + 00:00 heroku [api]:用命令启动进程 bash by [email protected]
2015-02-06T10:41:18.300710 + 00:00 heroku [run.5301]:等待客户
2015-02-06T10:41:18.335348 + 00:00 heroku [run.5301]:用命令启动进程 bash
2015-02-06T10:41:18.590203 + 00:00 heroku [run.5301]:状态从开始变为
2015-02-06T10:41:23.138727 + 00:00 heroku [ run5301]:进程退出状态为0
2015-02-06T10:41:23.148562 + 00:00 heroku [run.5301]:状态由up改为完成
2015-02-06T13: 37:04.131811 + 00:00 heroku [api]:用命令启动进程 cat procfile by [email protected]
2015-02-06T13:37:08.374192 +00:00 heroku [run.3797]:用命令启动进程 cat procfile
2015-02-06T13:37:08.338415 + 00:00 heroku [run .3797]:等待客户
2015-02-06T13:37:08.560954 + 00:00 heroku [run.3797]:状态从开始变为
2015-02-06T13:37:10.089507+ 00:00 heroku [run.3797]:进程已退出,状态为0
2015-02-06T13:37:10.113779 + 00:00 heroku [run.3797]:从状态变为完成
2015 -02-06T23:48:45 .731958 + 00:00 heroku [api]:部署6b11519 by [email protected]
2015-02-06T23:48:45.731958 + 00:00 heroku [api]:发布v8由[email protected]创建
2015-02-07T00:09:59.480138 + 00:00 heroku [api]:发布v9由[email protected]创建
2015-02-07T00:09:59.480138 + 00:00 heroku [ api]:部署6b11519 by [email protected]
2015-02-07T00:10:48.844680 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/host = mighty-falls-2323.herokuapp.com request_id = 7d1f4f4f-ef77-463c-a7ea-b8f324a659e7 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015 -02-07T00:10:50.372417 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/ favicon.icohost = mighty-falls-2323。 herokuapp.com request_id = cb478ca0-26db-4190-a352-73fac8e593bf fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-07T00:11:20.708121 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程正在运行 hod = POST path =/ testhost = mighty-falls-2323.herokuapp.com request_id = 257aa4ce-fcc5-478a-866e-16b5e06e6b28 fwd =223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-07T00:25:01.892151 + 00:00 heroku [api]:发布v10由[email protected]创建
2015-02-07T00:25:01.892151 + 00:00 heroku [api ]:部署f656bf6由[email protected]
2015-02-07T00:25:15.504015 + 00:00 heroku [路由器]:在=错误代码= H14 desc =没有web进程运行方法= GET路径dyno = connect = service = status = 503 bytes =
2015- 02-07T00:25:16.299068 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/ favicon.icohost = mighty-falls-2323.herokuapp .com request_id = 4bc9fe23-ef1c-4558-8dbc-e7a076184251 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-07T00:26:58.704016 + 00:00 heroku [路由器]:at =错误代码= H14 desc =没有web进程运行method = POST路径=/测试主机= mighty-falls-2323.herokuapp.com request_id = 2d0d428b-6e82-4fba-8bca-62b165dc9a8a fwd =223.66.227.40dyno =连接=服务=状态= 503字节=
2015-02-07T00:26:59.276275 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ testhost = mighty-下载 - 2323.herokuapp.com request_id = 56f32a41-ca5d-4177-af86-b5be5122e1a0 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-07T00:26:59.401230+ 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ testhost = mighty-falls-2323.herokuapp.com request_id = 3c74db5e-a184-43c6- 8509-6d2652f98ad5 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-07T00:26:59.759710 + 00:00 heroku [router]:at = error code = H14 desc =没有Web进程正在运行method = POST路径=/ testhost = mighty-falls-2323.herokuapp.com request_id = ddb0c3bf-d037-4e88-91d0-527c3bdc5294 fwd =223.66.227.40dyno = connect = service =状态= 50 3个字节=
2015-02-07T00:27:00.002293 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ testhost = dyno = connect = service = status = 503 bytes =
2015-02-07T00:28: 00.200540 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ testhost = mighty-falls-2323.herokuapp.com request_id = 4c3972ce-cf8d- 455a-9642-fb7ab27614ab fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-07T00:27:31.036773 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程正在运行method = POST path =/ testhost = mighty-falls-2323.herokuapp.com request_id = 7d8cd1cf-047c-4f31-a77a-67d2fd407f3e fwd =223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-07T00:38:10.241481 + 00:00 heroku [api]:部署bce1b94 by [email protected]
2015-02-07T00: 10.241481 + 00:00 heroku [api]:发布v11创建[email protected]
2015-02-07T00:47:15.189446 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/host = mighty-falls-2323.herokuapp.com request_id = d1e0f728-f37d-4bbc-934d-710a1bc6c038 fwd =223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-07T00:47 :16.032290 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/ favicon.icohost = mighty-falls-2323.herokuapp.com request_id = 922e5bee -44c7-4175-b04a-c678ea892c49 fwd =223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-07T05:39:16.650160 + 00:00 heroku [router]:at =错误代码= H14 desc =没有Web进程运行方法= GET路径=/主机= mighty-falls-2323.herokuapp.com request_id = 20cda673-a9d5-4235-8c56-7d4ade42d3af fwd =223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-07T05:42:18.957812 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET路径=/ testhost = mighty-falls-2323.herok uapp.com request_id = 21b650da-b678-4e0f-b25c-07ce57dade4a fwd =223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-07T05:42:30.441817 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/host = mighty-falls-2323.herokuapp.com request_id = 736b31a0-54bd-426e-b139-82e9e3b59cfb fwd = 223.66.226.41dyno = connect = service = status = 503 bytes =
2015-02-07T05:43:17.115422 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行方法= POST路径=/测试主机= mighty-falls-2323.herokuapp.com request_id = cf5fc45d-7de3-4ceb-9ddb-e0359e9bee7e fwd =223.66.227.40dyno =连接=服务=状态= 503字节=
2015-02-07T05:43:28.889811 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ testhost = mighty- falls-2323.herokuapp.com request_id = c28de66f-47fc-43e2-ba31-2cc9f75b60e7 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-07T05:45:00.848077+ 00:00 heroku [路由器]:at = e rror code = H14 desc =没有web进程正在运行method = POST path =/ equationshost = mighty-falls-2323.herokuapp.com request_id = fa17ce1f-3fdf-4d6f-93af-00b4182f39d8 fwd =223.66.226.41 dyno = connect = service = status = 503 bytes =
2015-02-07T08:27:44.307547 + 00:00 heroku [api]:部署83dff7d by [email protected]
2015-02-07T08 :27:44.307703 + 00:00 heroku [api]:发布v12由[email protected]创建
2015-02-07T08:28:22.236893 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST路径=/ testhost = mighty-falls-2323.herokuapp.com request_id = f42d825a-11ab-429b-8f37-cf1c2e2fa891 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-07T08:28:38.028373 + 00:00 heroku [router]:at = error code = H14 desc =没有web进程运行method = POST path =/ testhost = mighty-falls-2323.herokuapp.com request_id = 04e4cf42-ef58-44a4-92d7-5a62598260d7 fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02- 07T08:29:15.618833 + 00:00英雄ku [router]:at = error code = H14 desc =没有web进程运行method = GET path =/host = mighty-falls-2323.herokuapp.com request_id = 869ae9c3-4132-43d6-b84b-f8a4ea47375f fwd =223.66.227.40dyno = connect = service = status = 503 bytes =
2015-02-07T08:30:25.316324 + 00:00 heroku [api]:通过[email protected]部署83dff7d
2015-02-07T08:30:25.316324 + 00:00 heroku [api]:发布v13由[email protected]创建



我也尝试过heroku ps:scale web = 1命令:
$ b $ p code>缩放dynos失败
!没有在Procfile中定义的这样的进程类型的web。



python代码(在名为index.py的文件中):



pre $ from flask import烧瓶,make_response,请求,json
导入json
$ b $ app =烧瓶(__ name__)

@ app.route('/ test',methods = ['POST'])
def test():
resultJson = json.dumps(request.get_json())
response = app.response_class(resultJson,mimetype ='application / json')
返回响应
$ b $如果__name__ =='__main__':
app.debug = True
app.run(host ='0.0.0.0')

p>

  web:gunicorn app:app 

(我跟着dirn的建议把procfile的内容改成web:gunicorn index:app,但是错误还是在这里。)

要求.txt:

  Flask> = 0.9 
Jinja2> = 2.7.2
Werkzeug> = 0.9。 4
gunicorn> = 18.0

由于我对这些东西不熟悉,所以我只是复制并粘贴其他人的Procfile和requirements.txt。 >

所有文件都在一个目录中。

在本地环境中,我只需要打开终端,然后运行命令:python〜/ index.py,终端显示:

  *在http://0.0.0.0:5000/上运行
*使用重新载入程序重新启动

然后一切正常。从客户端应用程序,我可以发布到URL:与一些json数据,而客户端应用程序将收到相同的json数据。



我不知道如何解决这个问题。我只是想在服务器上运行这个脚本,脚本可以响应客户端应用程序的请求从互联网。

问题出在你的 Procfile 上。

  web:gunicorn app:app 

这告诉gunicorn运行名为 app 的WSGI应用程序,该应用程序可以在名为 app 。但是,您的模块被命名为 index 。

您可以将 index.py 重命名为 app.py 或将 procfile 的内容更改为

  web:gunicorn index:app 


I'm new to python and flask.The flask's document says you can deploy your app to heroku for public access. So I turned to heroku site. I followed the getting started guide step by step. I deployed the app successfully, but when I tested with the given url like https://mighty-falls-2223.heroku.com/, it said there was error.

The error message is:

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.

I tried heroku logs command:

2015-02-06T05:05:23.598482+00:00 heroku[api]: Release v2 created by [email protected]:05:23.598482+00:00 heroku[api]: Enable Logplex by [email protected]:43:45.975680+00:00 heroku[api]: Deploy 6c41484 by [email protected]:43:45.975680+00:00 heroku[api]: Release v3 created by [email protected]:45:21.762316+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=a2351725-38cb-4480-a97a-b9cf84b1c8ec fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-06T05:45:24.285661+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=mighty-falls-2323.herokuapp.com request_id=80d64b3a-3da7-4836-a653-0040b43acd0a fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-06T05:45:58.722807+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/" host=mighty-falls-2323.herokuapp.com request_id=5864f9d0-f4cb-438d-acc6-74c1afb05188 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-06T05:46:20.066306+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=1b62f73b-3240-4428-bc77-112801685486 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-06T05:47:57.279689+00:00 heroku[api]: Deploy 6c41484 by [email protected]:47:57.279689+00:00 heroku[api]: Release v4 created by [email protected]:02:22.868450+00:00 heroku[api]: Release v5 created by [email protected]:02:22.868450+00:00 heroku[api]: Deploy 38003ed by [email protected]:02:41.211691+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=0be3ab2e-e3d3-4186-8ae2-fddcd5919f11 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-06T06:03:12.755692+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=dbdcb909-ee4a-4c37-ade0-a2f38d9bad3e fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-06T06:03:58.407684+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=52d528be-0e19-491d-b80f-a6ed468a687c fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-06T06:08:41.991908+00:00 heroku[api]: Deploy 9d0211e by [email protected]:08:41.991908+00:00 heroku[api]: Release v6 created by [email protected]:09:11.138002+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=c2164d36-0c85-43fb-87d0-d637b011116e fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-06T06:09:37.362330+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=49c04057-1a7b-432d-a8a8-7d5687b717d1 fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-06T06:10:15.040200+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/index.py/test" host=mighty-falls-2323.herokuapp.com request_id=ef7a49b4-fc15-4876-ae0a-30c866fb6ccd fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-06T08:03:09.470102+00:00 heroku[api]: Release v7 created by [email protected]:03:09.470102+00:00 heroku[api]: Deploy 9d0211e by [email protected]:03:38.874551+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=3e7ebf43-d55f-4831-98ee-3758957c6110 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-06T10:21:31.070674+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=8c2a7f5b-3382-4685-9e50-8415fbfc8703 fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-06T10:25:42.879279+00:00 heroku[api]: Starting process with commandfalse && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat Procfileby [email protected]:25:46.887330+00:00 heroku[run.4361]: Awaiting client2015-02-06T10:25:46.921078+00:00 heroku[run.4361]: Starting process with commandfalse && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat Procfile2015-02-06T10:25:48.553909+00:00 heroku[api]: Starting process with commandfalse && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat requirements.txtby [email protected]:25:47.174906+00:00 heroku[run.4361]: State changed from starting to up2015-02-06T10:25:49.052088+00:00 heroku[run.4361]: Process exited with status 02015-02-06T10:25:49.061559+00:00 heroku[run.4361]: State changed from up to complete2015-02-06T10:25:55.154435+00:00 heroku[run.5301]: Awaiting client2015-02-06T10:25:55.187005+00:00 heroku[run.5301]: Starting process with commandfalse && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat requirements.txt2015-02-06T10:25:55.608338+00:00 heroku[run.5301]: State changed from starting to up2015-02-06T10:25:57.225198+00:00 heroku[run.5301]: Process exited with status 02015-02-06T10:25:57.237272+00:00 heroku[run.5301]: State changed from up to complete2015-02-06T10:41:02.655049+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=88ad749c-b3c0-41da-8522-052c25beaa58 fwd="82.227.198.77" dyno= connect= service= status=503 bytes=2015-02-06T10:41:02.986494+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=mighty-falls-2323.herokuapp.com request_id=3cb538b8-7020-49c5-8d5f-4752ed41bf17 fwd="82.227.198.77" dyno= connect= service= status=503 bytes=2015-02-06T10:41:14.129885+00:00 heroku[api]: Starting process with commandbashby [email protected]:41:18.300710+00:00 heroku[run.5301]: Awaiting client2015-02-06T10:41:18.335348+00:00 heroku[run.5301]: Starting process with commandbash2015-02-06T10:41:18.590203+00:00 heroku[run.5301]: State changed from starting to up2015-02-06T10:41:23.138727+00:00 heroku[run.5301]: Process exited with status 02015-02-06T10:41:23.148562+00:00 heroku[run.5301]: State changed from up to complete2015-02-06T13:37:04.131811+00:00 heroku[api]: Starting process with commandcat Procfileby [email protected]:37:08.374192+00:00 heroku[run.3797]: Starting process with commandcat Procfile2015-02-06T13:37:08.338415+00:00 heroku[run.3797]: Awaiting client2015-02-06T13:37:08.560954+00:00 heroku[run.3797]: State changed from starting to up2015-02-06T13:37:10.089507+00:00 heroku[run.3797]: Process exited with status 02015-02-06T13:37:10.113779+00:00 heroku[run.3797]: State changed from up to complete2015-02-06T23:48:45.731958+00:00 heroku[api]: Deploy 6b11519 by [email protected]:48:45.731958+00:00 heroku[api]: Release v8 created by [email protected]:09:59.480138+00:00 heroku[api]: Release v9 created by [email protected]:09:59.480138+00:00 heroku[api]: Deploy 6b11519 by [email protected]:10:48.844680+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=7d1f4f4f-ef77-463c-a7ea-b8f324a659e7 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:10:50.372417+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=mighty-falls-2323.herokuapp.com request_id=cb478ca0-26db-4190-a352-73fac8e593bf fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:11:20.708121+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=257aa4ce-fcc5-478a-866e-16b5e06e6b28 fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-07T00:25:01.892151+00:00 heroku[api]: Release v10 created by [email protected]:25:01.892151+00:00 heroku[api]: Deploy f656bf6 by [email protected]:25:15.504015+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=ef792387-7275-473a-94a4-fd6d79193606 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:25:16.299068+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=mighty-falls-2323.herokuapp.com request_id=4bc9fe23-ef1c-4558-8dbc-e7a076184251 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:26:58.704016+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=2d0d428b-6e82-4fba-8bca-62b165dc9a8a fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:26:59.276275+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=56f32a41-ca5d-4177-af86-b5be5122e1a0 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:26:59.401230+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=3c74db5e-a184-43c6-8509-6d2652f98ad5 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:26:59.759710+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=ddb0c3bf-d037-4e88-91d0-527c3bdc5294 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:27:00.002293+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=b8213dc4-68f9-4506-9df3-8f8d9d84c17e fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:27:00.200540+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=4c3972ce-cf8d-455a-9642-fb7ab27614ab fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T00:27:31.036773+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=7d8cd1cf-047c-4f31-a77a-67d2fd407f3e fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-07T00:38:10.241481+00:00 heroku[api]: Deploy bce1b94 by [email protected]:38:10.241481+00:00 heroku[api]: Release v11 created by [email protected]:47:15.189446+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=d1e0f728-f37d-4bbc-934d-710a1bc6c038 fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-07T00:47:16.032290+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=mighty-falls-2323.herokuapp.com request_id=922e5bee-44c7-4175-b04a-c678ea892c49 fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-07T05:39:16.650160+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=20cda673-a9d5-4235-8c56-7d4ade42d3af fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-07T05:42:18.957812+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/test" host=mighty-falls-2323.herokuapp.com request_id=21b650da-b678-4e0f-b25c-07ce57dade4a fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-07T05:42:30.441817+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=736b31a0-54bd-426e-b139-82e9e3b59cfb fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-07T05:43:17.115422+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=cf5fc45d-7de3-4ceb-9ddb-e0359e9bee7e fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T05:43:28.889811+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=c28de66f-47fc-43e2-ba31-2cc9f75b60e7 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T05:45:00.848077+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/equations" host=mighty-falls-2323.herokuapp.com request_id=fa17ce1f-3fdf-4d6f-93af-00b4182f39d8 fwd="223.66.226.41" dyno= connect= service= status=503 bytes=2015-02-07T08:27:44.307547+00:00 heroku[api]: Deploy 83dff7d by [email protected]:27:44.307703+00:00 heroku[api]: Release v12 created by [email protected]:28:22.236893+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=f42d825a-11ab-429b-8f37-cf1c2e2fa891 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T08:28:38.028373+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/test" host=mighty-falls-2323.herokuapp.com request_id=04e4cf42-ef58-44a4-92d7-5a62598260d7 fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T08:29:15.618833+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mighty-falls-2323.herokuapp.com request_id=869ae9c3-4132-43d6-b84b-f8a4ea47375f fwd="223.66.227.40" dyno= connect= service= status=503 bytes=2015-02-07T08:30:25.316324+00:00 heroku[api]: Deploy 83dff7d by [email protected]:30:25.316324+00:00 heroku[api]: Release v13 created by [email protected]

I also tried heroku ps:scale web=1 command:

Scaling dynos... failed ! No such process type web defined in Procfile.

the python code(in the file named index.py) :

from flask import Flask, make_response, request, json
import json

app = Flask(__name__)

@app.route('/test', methods = ['POST'])
def test():
    resultJson = json.dumps(request.get_json())
    response = app.response_class(resultJson, mimetype = 'application/json')
    return response

if __name__ == '__main__':
    app.debug = True
    app.run(host='0.0.0.0')

the Procfile:

web:gunicorn app:app

(I have followed dirn's suggestion to change Procfile content to web:gunicorn index:app, But the error is still here.)

the requirements.txt :

Flask>=0.9
Jinja2>=2.7.2
Werkzeug>=0.9.4
gunicorn>=18.0

Since I am new to these things, so I just copy and paste others' Procfile and requirements.txt .

All the files are in one directory.

In the local environment, I just need to open terminal, and run command: python ~/index.py, and the terminal shows:

* Running on http://0.0.0.0:5000/
* Restarting with reloader

Then everything is working as it is. From the client app, I can post to url:http://0.0.0.0:5000/test with some json data, and the client app will receive the same json data.

I don't know how to fix it. I just want to run this script in a server and the script can response to the client app's request from the Internet.

解决方案

The problem is with your Procfile.

web:gunicorn app:app

This tells gunicorn to run the WSGI application named app that can be found in a module or package named app. Your module, however, is named index.

You can either rename index.py to app.py or change the contents of your Procfile to

web:gunicorn index:app

这篇关于heroku不能使用我的python脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 00:23