Book Image

Learning Flask Framework

Book Image

Learning Flask Framework

Overview of this book

Table of Contents (17 chapters)
Learning Flask Framework
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Running Flask with a WSGI server


It is important to note that Flask, by itself, is not a web server. Web servers are tools that are Internet-facing, have had many years of development and patching applied to them, and can run many services at once.

Running Flask by itself as a Web server on the Internet will most likely be fine, thanks to the Werkzeug WSGI layer However, the real focus of development on Flask is page-routing and rendering the system. Running Flask as a web server may have unintended effects. Ideally, Flask will sit behind a web server and be called upon when the server recognizes a request for your app. To do this, the web server and Flask need to be able to speak the same language.

Fortunately the Werkzeug stack, upon which Flask is built, is designed to speak WSGI. WSGI is a common protocol used by web servers such as Apache's httpd and Nginx. It can be used to manage the load on your Flask app and communicate the important bits of information about where the requests came...