2

According to Flask's documentation:

You can use the builtin server during development, but you should use a full deployment option for production applications.

Assume I am using mod_wsgi.

Is Flask still running "under the hood" with Apache delegating to it or is Flask "gone"? According to this SO, one of Flask's obvious limitations is that it is single-threaded. If Apache is just delegating to Flask, wouldn't we run into the same issues? And if not, what is Flask for at all? What makes it a "Flask application"? In other words, is a production Flask application running under an Apache server really a Flask application and if so, why?

Community
  • 1
  • 1
jds
  • 7,910
  • 11
  • 63
  • 101

1 Answers1

6

Flask is not the development server, it's a framework for handling the request/response cycle of a web application. (The dev server isn't even part of Flask, it's part of Werkzeug.)

A deployed project typically consists of a web server (Apache, Nginx, etc.), an application server (mod_wsgi, uwsgi, gunicorn, etc.), and a WSGI application (Flask in this case).

The development server just makes it easy to run your app when you don't have a real application server set up. In your case, mod_wsgi takes the place of the development server, both of which run the Flask application.

davidism
  • 121,510
  • 29
  • 395
  • 339