[英]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: 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.