Flask Default server issue
<p>To be Clear, I am well aware that flask's built in server which uses werkzeug cannot be used as a full blown server and should be replaced with Mod_wsgi or something else.</p>

<p>But , My requirement is to serve only one request at a time but if another request comes in while the first one is being served, it should queue up and execute it one by one.</p>

<p>Can Flask do that? </p>

<p>Also,</p>

<p>I Read the documents and there was an option like below</p>

<blockquote>
  <p>app.run(host="10.343.34534.34543", port=6846,threaded=True)</p>
</blockquote>

<p>What does threaded=true mean?</p>

<p><code>flask.Flask.run</code> accepts keyword arguments eg. <code>threaded=True</code> that it forwards to <code>werkzeug.serving.run_simple</code> two of those arguments are: threaded which enables threading, and processes, which you can set to have Werkzeug spawn more than one process to handle requests. So if you do:</p>

<pre><code>if __name__ == '__main__':
app.run(threaded=True)
# Alternately
# app.run(processes=3)
</code></pre>

<p>Flask will tell Werkzeug to use threading and to spawn three processes to handle incoming requests.</p>

<p>All of that being said, a WSGI like Gunicorn should be used in a production environment. Not Werkzeug.</p>

python flask server