我一直坚持试图让我的简单bottle
应用程序启动时部署在heroku上。与gunicorn - hero工作在heroku上的应用程序本地工作,但不heroku
经过相当多的搜索和修补后,我有一个本地工作的设置,但不是在heroku上。
在/app.py
:
import bottle
import beaker.middleware
from bottle import route, redirect, post, run, request, hook, template, static_file, default_app
bottle.debug(True)
app = beaker.middleware.SessionMiddleware(bottle.app(), session_opts)
...
# app routes etc, no run()
然后在/Procfile
:
web: gunicorn app:app --bind="0.0.0.0:$PORT" --debug
纠正我,如果我误解是如何工作的gunicorn,我明白了 “应用:应用” 部分为外观的模块中(=文件)称为app.py并使用变量“app”中的任何内容作为WSIG,是的?
- 如果$端口设置,我通过
$ heroku run bash
检查,似乎确定 - 的“0.0.0.0” IP我已经从其他Heroku的例子有,应该反正接受任何IP地址的服务器端,不是吗?
- Python的依赖关系似乎得到安装精细
- 我有了这个由通过
.env
文件工头设置$POST
变量本地运行,一切似乎都基于this SO question我检查$ heroku ps
在我的设置
- 工作确定
=== web (1X): `gunicorn app:app --bind="0.0.0.0:$PORT" --debug` web.1: crashed 2014/12/24 22:43:00 (~ 1m ago)*)
- 而
$ heroku logs
显示:
2014-12-24T20:42:59.235657+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --bind="0.0.0.0:23177" --debug` 2014-12-24T20:43:00.434570+00:00 heroku[web.1]: State changed from starting to up 2014-12-24T20:43:01.813679+00:00 heroku[web.1]: State changed from up to crashed 2014-12-24T20:43:01.803122+00:00 heroku[web.1]: Process exited with status 3
不知道我真的怎么能得到更好的调试结果无论是。不知何故,Procfile
网络进程似乎并没有工作/开始,但我怎样才能获得关于破解的信息?
任何人都有想法这里发生了什么?
P.S:我是相当新的Heroku的,蟒蛇,瓶& gunicorn:O型
谢谢,试过了,尽管我找不到'--log-file'选项,但也许'--access-logfile =“ - ”'也一样吗?结果仍然是一样的,本地作品,在heroku上的应用程序崩溃。 – kontur
否 - 访问日志文件是accesslog。 --log文件是错误日志。 http://gunicorn-docs.readthedocs.org/en/latest/settings.html#errorlog – methane
啊,这样做。有错误的痕迹,显然我有一个模块错误地(但本地)在.gitignore,这使得整个事情崩溃,并在heroku上烧伤。当我查看文档时,我也没有看到命令别名,所以谢谢指出:) – kontur