简体   繁体   中英

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

  1. Procfile
  2. flask_app.py
  3. requirements.txt
  4. runtime.txt

1: Profile contains the following

web: gunicorn app:app

2: flask_app.py contain the following code

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

python-3.8.3

4: requirements.txt contain

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

I think there is some problem with Procfile. It should be

web: gunicorn wsgi:app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM