Categories
Python Answers

How to serve multiple clients using just Python Flask app.run() as standalone?

Spread the love

Sometimes, we want to serve multiple clients using just Python Flask app.run() as standalone.

In this article, we’ll look at how to serve multiple clients using just Python Flask app.run() as standalone.

How to serve multiple clients using just Python Flask app.run() as standalone?

To serve multiple clients using just Python Flask app.run() as standalone, to set the threaded argument to False.

For instance, we write

if __name__ == '__main__':
    app.run(threaded=False, processes=3)

to call app.run with threaded set to False and `proceses set to 3 to spawn 3 processes.

Conclusion

To serve multiple clients using just Python Flask app.run() as standalone, to set the threaded argument to False.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *