Issues deploying

Hi there, I was trying to deploy a very quick flask api.

It seems to deploy fine with the logs saying the classic flask “dont do what your doing”

04/05/2023, 19:56:42	* Debugger PIN: 426-690-830
04/05/2023, 19:56:42	* Debugger is active!
04/05/2023, 19:56:42	* Restarting with stat
04/05/2023, 19:56:42	e[33mPress CTRL+C to quite[0m
04/05/2023, 19:56:42	e[31me[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.e[0m * Running on http://127.0.0.1:8080
04/05/2023, 19:56:42	* Serving Flask app 'main' * Debug mode: on
04/05/2023, 19:56:26	Starting container

But then the deploymnet fails and i get this

error: The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information. For additional support, please post on https://ask.replit.com/c/help/13 and a staff member will take a look. - 2023-05-04T18:43:04.762Z

https://replit.com/@redflamingarrow/swipeapi

Thanks.

Hey! Happy to help you debug this. When you deployed, you set the deployment to “web server”, right?

Also, do you see any useful messages in the “logs” tab?

Just following up on this – based on your screenshot, it looks like you’re listening on 127.0.0.1. In order for your server to work on Replit (both in the workspace and in a deployment), you need to listen on 0.0.0.0 instead.

1 Like