jason translol
jason translol

Reputation: 73

Threaded=true Flask larger application file structure

I recently created a web app and used the suggested file structuring from flask for separating views in different files. see here, http://flask.pocoo.org/docs/0.12/patterns/packages/.

But I also need to have the threaded parameter set to true which I would usually do at app.run(threaded=True) stage of testing. But I now run the app a different way, i tried putting "threaded=True" into my setup.py and that didn't do anything and was wondering how to get this working.

Upvotes: 5

Views: 2935

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1124288

Just tell the flask run command to use threads:

$ export FLASK_APP=yourapplication
$ flask run --with-threads

Don't put this decision in your code; it is up to your WSGI server to run with threads or not.

You can see what options flask run accepts with flask run --help.

Upvotes: 5

Related Questions