user12578371
user12578371

Reputation:

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

Upvotes: 0

Views: 97

Answers (1)

Vinay Jain
Vinay Jain

Reputation: 26

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

web: gunicorn wsgi:app

Upvotes: 1

Related Questions