Rohan
Rohan

Reputation: 77

Python Flask with Waitress WSGI not working with Heroku

I was learning about building web apps and putting them on Heroku.

I made a basic HTML website, which runs perfectly on the local server but it's showing "Application Error " on Heroku. I was initially using gunicorn (which was giving me an H10 error), then I later learnt that gunicorn was incompatible with Windows so I switched to Waitress WSGI. This time I am getting an H14 error code.

I tried heroku ps:scale web=1

and I am getting this error : Scaling dynos... ! ! Couldn't find that process type (web).

I tried almost everything that's there on the internet, but sadly I am not able to get past the error and host my website. It's really frustrating.

This is my current Procfile: waitress-serve --listen=*:8000 website.wsgi:app

I have also tried waitress-serve --listen=*:8000 website.py:app, the errors were indistinguishable :(

This is my Heroku log output :-

2020-07-06T08:08:03.848586+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=brohan-wsite.herokuapp.com request_id=72a95aa5-8d84-486f-b036-dc738d9cc62c fwd="106.215.63.163" dyno= connect= service= status=503 bytes= protocol=https

Upvotes: 3

Views: 2280

Answers (1)

MikeP
MikeP

Reputation: 66

You might need something like:

web: waitress-serve --port=$PORT website:app

Heroku defines the port dynamically, so hardcoding port 8000 won't work.

Upvotes: 5

Related Questions