How to fix 'flask' it says : "Use a production WSGI server instead"

I am studing with flask, and i need help with this:
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead
What should I do with it?

Hello @Bimo Replit is a cloud Ide for development purpose I.e. you can develop your projects code here but it has very limited functionality if you want to deploy your developed app for public use that’s why Warning is displayed!!

You can continue using it for learning purpose. Hope this helps :slight_smile:

No, that’s not why the warning is there @fury-05. It’s completely fine to develop and deploy on Replit, but the warning that @Bimo asked about is that the default Flask server isn’t for deployment.

When running publicly rather than in development, you should not use the built-in development server (flask run). The development server is provided by Werkzeug for convenience, but is not designed to be particularly efficient, stable, or secure.

@Bimo have a look into something like Waitress for production. If you’re still developing your project, it’s completely fine to use the built-in server.
https://flask.palletsprojects.com/en/2.2.x/tutorial/deploy/

To set this up, you would need to modify the run command in your .replit file.
https://docs.replit.com/programming-ide/configuring-repl

2 Likes

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