Can't deploy Flask App using Gunicorn

I have a simple flask app that I am trying to deploy onto a gunicorn production server. When I try to deploy it, I get the following messages:

exec [sh -c gunicorn -w -b main:app] error=exit status 127
sh: 1: gunicorn: not found

My replit.nix file include gunicorn, and I have this run command:

run = ["sh", "-c", "gunicorn -w -b main:app"]

however, I have also tried:

["sh", "-c", "gunicorn main:app -w 4 -b 0.0.0.0:$PORT"]

Nothing I have tried in the last few hours has worked, other than removing gunicorn altogether.

Is there any quick fix?
Thanks

repl is here

1 Like

flask never worked for me with deployments honestly just use a reserved VM, ik its paid :confused: but thats the only way for py scripts now

Thanks meIs7 !

Will this run on a proper production server, or will it be a development server?

I’m thinking about the warning that shows up when I run it in replit:
“WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.”

Thanks again!

2 Likes

should work without flask since its a dedicated machine with 99.9% uptime :+1:

2 Likes

Thanks! will do it that way!

@alexb119 Flask does work on Autoscale deployments. You do not have to pay for a Reserved VM. You can safely ignore the “WARNING: This is a development server. Do not use it in a production deployment”. This means nothing.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.