Issue pushing python app to Heroku, "python: can't open file '/app/App.py'

33 views Asked by At

I have a simple Python app that works well locally without issue. I have a python app coded in VS Code with javascript, CSS, and HTML.

When I try to push to Heroku I keep getting errors no matter what I keep trying!

Here is the error I keep getting in the logs --tail

2024-01-13T20:46:22.625482+00:00 app[web.1]: python: can't open file '/app/App.py': [Errno 2] No such file or directory

My current Project directory tree looks like this

|--vollyball_practice_tracker
|   |--static
|      |-script.js
|      |-styles.css
|   |--templates
|      |--index.html
|   |--App.py
|   |--Pipfile
|   |--Procfile
|   |--requirements.txt

This is my App.py code:

from flask import Flask, render_template, request

app = Flask(__name__, static_url_path='/static', static_folder='static')

@app.route('/')
def index():
    return render_template('index.html')

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=8000)

Here is what my Procfile looks like:

web: pipenv run python App.py

And here is my requirements file:

blinker==1.7.0
click==8.1.7
Flask==3.0.0
importlib-metadata==7.0.1
itsdangerous==2.1.2
Jinja2==3.1.3
MarkupSafe==2.1.3
Werkzeug==3.0.1
zipp==3.17.0

I have tried running it with and without a Pip, I have tried to change my directory tree slightly and change my requirements and Procfile.

I'm very new to this so forgive me if the code doesn't look great!

Please, any help to get this published online would be fantastic!

Thanks.

0

There are 0 answers