3
votes

I am trying to deploy a flask app I made to Heroku with success. The app is generated but I get errors when I push the code to the Heroku repository.

My flask app is inside a module called server.py and the variable is named app. At first I tried using gunicorn and writing web: gunicorn server:app and deplying but no web dynos were up and I get an error stating it is the Procfile file. Red about it about and saw that Gunicorn is not really working on windows so I tried installing Waitress and deploying without success. this time my profcile was written as all of these (tried several times):

web: waitress-serve --listen=*:8000 server.wsgi:application

web: waitress-serve --listen=*:8000 app.wsgi:application And so on.

to add a web dyno I should scale it because heroku ps: showes that there is no dynos.

When I try to run heroku ps:scale web=1 I get:

Scaling dynos... ! ▸ Couldn't find that process type.

What am i doing wrong?

1
Did you able to work it out?Soumendra

1 Answers

0
votes

I was having the same problem. Particularly, waitress works locally in Windows (inside a Procfile.windows file web: waitress-serve index:server, then with heroku CLI heroku local -f Procfile.windows), but failed after Heroku deployment. Workaround for me was to locally test with waitress (like explained), but deploy with gunicorn (web: gunicorn index:server inside Procfile). Let me know if this works for you.