简体   繁体   English

应用程序错误:我的 Flask-web-app 已成功部署在 Heroku 上,但在加载站点时收到应用程序错误

[英]Application error: My Flask-web-app is successfully deploy on Heroku but receiving application error when loading site

the project structure is following项目结构如下

myapp is a root directory and it has the following files myapp 是一个根目录,它有以下文件

  1. Procfile档案
  2. flask_app.py烧瓶应用程序.py
  3. requirements.txt要求.txt
  4. runtime.txt运行时.txt

1: Profile contains the following 1:配置文件包含以下内容

web: gunicorn app:app

2: flask_app.py contain the following code 2:flask_app.py 包含以下代码

from flask import Flask
app = Flask(__name__)


@app.route('/')
def index():
    return 'Welcome to my web '

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

3: runtime.txt contain 3:runtime.txt 包含

python-3.8.3

4: requirements.txt contain 4:requirements.txt 包含

click==7.1.2
Flask==1.1.2
gunicorn==20.0.4
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
Werkzeug==1.0.1

Executing these command执行这些命令

$ heroku login

$ git init 

$ heroku git:remote -a appname

$ git add.

$ git commit -am "make it better"

$ git push heroku master

after executing the last command when I am clicking on the link it gives me the following error在我单击链接时执行最后一个命令后,它给了我以下错误

Application error应用程序错误

An error occurred in the application and your page could not be served.应用程序发生错误,无法提供您的页面。 If you are the application owner, check your logs for details.如果您是应用程序所有者,请查看您的日志以了解详细信息。 You can do this from the Heroku CLI with the command Heroku logs --tail您可以从 Heroku CLI 使用命令 Heroku logs --tail 执行此操作

I think there is some problem with Procfile.我认为 Procfile 有一些问题。 It should be它应该是

web: gunicorn wsgi:app

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Heroku 应用程序成功部署,但在加载站点时收到应用程序错误 - Heroku app successfully deploying, but receiving an application error when loading site Heroku 应用成功部署,但加载站点时收到应用程序错误 - Heroku app successfully deploying, but receiving application error when loading site Heroku 应用程序成功部署,但在加载站点时收到应用程序错误。 但我似乎可以找到一个错误 - Heroku app successfully deploying, but receiving application error when loading site. But I can seem to find an error Heroku 应用程序成功部署,但打开应用程序时收到应用程序错误 - Heroku app successfully deployed, but receiving application error when opening app Heroku 应用成功部署,但收到应用错误 - Heroku app successfully deploying, but receiving application error 我在 Heroku 上成功部署了我的 Web 应用程序,但显示应用程序错误 - I successfully deployed my web app on Heroku but shows Application Error Heroku 部署 Flask 应用程序时出现“应用程序错误” - Heroku "Application error" when deploying Flask app Flask Heroku 上的应用程序在部署后出现应用程序错误 - Flask App on Heroku getting Application Error after deploy 在 Heroku 中启动我的 Python web 应用程序时出现应用程序错误 - Application Error when launching my Python web app in Heroku Heroku 应用部署成功但应用报错 - Heroku app deployed successfully but Application Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM