我已经在Heroku上部署了一个使用Python中的Bottle框架制作的小型Web应用程序。我不知道为什么我会在这里得到 Boot 超时-
2013-12-25T17:53:23.098442+00:00 heroku[web.1]: Starting process with command `python myapp.py`
2013-12-25T17:53:25.230922+00:00 app[web.1]: Listening on http://127.0.0.1:31150/
2013-12-25T17:53:25.230695+00:00 app[web.1]: Bottle v0.11.6 server starting up (using GeventServer())...
2013-12-25T17:53:25.231052+00:00 app[web.1]: Hit Ctrl-C to quit.
2013-12-25T17:53:25.231052+00:00 app[web.1]:
2013-12-25T17:54:13.434121+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path=/ host=shrouded-spire-2869.herokuapp.com fwd="49.14.226.100" dyno= connect= service= status=503 bytes=
2013-12-25T17:54:23.622928+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2013-12-25T17:54:23.623289+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-12-25T17:54:24.890546+00:00 heroku[web.1]: Process exited with status 137
2013-12-25T17:54:24.901419+00:00 heroku[web.1]: State changed from starting to crashed
2013-12-25T17:54:26.867178+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=shrouded-spire-2869.herokuapp.com fwd="106.78.169.174" dyno= connect= service= status=503 bytes=
2013-12-25T17:53:36.038209+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path=/ host=shrouded-spire-2869.herokuapp.com fwd="49.14.226.100" dyno= connect= service= status=503 bytes=
这是myapp.py:
import gevent.monkey; gevent.monkey.patch_all()
import bottle
import requests
from pyquery import PyQuery as pq
import os
# Rest of the code here
run(server='gevent', port=os.environ.get('PORT', 5000))
你知道吗?
1条答案
按热度按时间zzzyeukh1#
您正在侦听
127.0.0.1
,而不是公用IP。请在呼叫run()
时使用host='0.0.0.0'
。