Just a precursor, I’ve looked at very similar questions on Stack Overflow and tried all the solutions suggested there however none of them worked so I’m assuming it’s something else I’m not getting. Also for various reasons I’m restricted to working exclusively online, and I can’t use any CLI commands I can only use the website as an interface.
I’ve been building a web-app with Flask (it works fine on repl.it), and I went to try host it on Heroku (connected through GitHub) but keep getting an "Application Error" when it loads with these two items in the log:
2022-08-09T08:48:18.336638+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=heroku-learning-temporary.herokuapp.com request_id=395ddf03-0a6e-4656-a185-09d6258ecfa9 fwd="18.104.22.168,22.214.171.124" dyno= connect= service= status=503 bytes= protocol=https 2022-08-09T08:48:19.449634+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=heroku-learning-temporary.herokuapp.com request_id=95dc333b-3e5c-46bf-867d-d8444ac3d35a fwd="126.96.36.199,188.8.131.52" dyno= connect= service= status=503 bytes= protocol=https
So I built a really simple Flask app just to try identify the problem but got the exact same error logs. The really simple flask app I built looked like this:
from flask import Flask app = Flask(__name__) @app.route("/") def index(): return("Hello there") if __name__ == "__main__": app.run(port=5000)
from app import app if __name__ == "__main__": app.run()
web: gunicorn wsgi:app
All of these are from the tutorial here with the exception of the requirements.txt which I added ’cause otherwise it failed in the build stage.
Is there something I’m not doing right? Or is it going wrong ’cause I’m not using the CLI but just using the website?
Also if it’s easier to view the code on GitHub my repository is here.
change your procfile to:
web: gunicorn app:app
your wsgi.py file can be deleted
Answered By – Fran Camacho