簡體   English   中英

部署到Heroku的Flask應用程序返回應用程序錯誤

[英]Flask application deployed to Heroku returns Application Error

我遇到heroku無法成功運行我的應用程序的麻煩。 我有3個關鍵文件:

  1. 帶有核心引擎的python文件。
  2. 一個python文件,該文件調用第一個python文件並運行Flask將render_template轉換為index.html ,並且
  3. 一個index.html文件,該文件使用核心引擎生成的數據(通過第二個python文件)來呈現頁面。

我將所有所需的依賴項記錄在了requirements.txt文件中,並按照此樣板頁面上的“部署到Heroku”中的說明進行操作

完成git push heroku master我在heroku應用程序上遇到了應用程序錯誤。 這是heroku日志轉儲:

(venv)Bobs-MacBook-Pro:headline master$ heroku logs
2014-09-15T08:04:42.500102+00:00 heroku[api]: Enable Logplex by xxx@gmail.com
2014-09-15T08:04:42.500102+00:00 heroku[api]: Release v2 created by xxx@gmail.com
2014-09-15T08:10:32+00:00 heroku[slug-compiler]: Slug compilation started
2014-09-15T08:11:21+00:00 heroku[slug-compiler]: Slug compilation finished
2014-09-15T08:11:21.409088+00:00 heroku[api]: Deploy fa8d344 by xxx@gmail.com
2014-09-15T08:11:21.409184+00:00 heroku[api]: Release v3 created by xxx@gmail.com
2014-09-15T08:11:23.833224+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=headlyneme.herokuapp.com request_id=6ea6633a-4bfa-4cfa-9345-ac77f570e6a9 fwd="54.82.116.215" dyno= connect= service= status=503 bytes=
2014-09-15T08:11:55.722627+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=headlyneme.herokuapp.com request_id=ed7d46ba-cef2-4aef-bbe6-49e8244cb04c fwd="24.130.57.252" dyno= connect= service= status=503 bytes=
2014-09-15T08:11:56.045572+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=headlyneme.herokuapp.com request_id=08d43fc9-977a-4c89-86a3-267224fbb5a7 fwd="24.130.57.252" dyno= connect= service= status=503 bytes=

我究竟做錯了什么? 我已經使用app.run(debug=True)在Mac上本地運行了此程序,沒有任何問題, 如此處所示 我猜測python文件運行的順序有問題嗎?

當您在推送其他文件后添加Procfile時,通常會發生這種情況。 因此,您的heroku應用程序不了解Procfile,並且沒有任何測功機在運行。

嘗試運行heroku ps:scale web=1形成一個dyno,這將有望使您的應用處理Web請求。 我希望這有幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM