Book Image

Python Essentials

By : Steven F. Lott
Book Image

Python Essentials

By: Steven F. Lott

Overview of this book

Table of Contents (22 chapters)
Python Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building web applications


Web applications involve a great deal of processing, which is best described as boilerplate. The essential handling of the HTTP protocol, for example, is often standardized, with libraries that handle it gracefully. The details of parsing request headers and mapping a URL path to a specific resource don't need to be reinvented.

There is, however, a profound distinction between simply handling the HTTP protocol and mapping a URL to an application-specific resource. These two layers drive the definition of the Web Services Gateway Interface (WSGI) design and the wsgi module is in the standard library. For more information, see Python Enhancement Proposal (PEP) 3333, https://www.python.org/dev/peps/pep-3333/.

The idea behind WSGI is that all web services should adhere to a single, minimum standard for handling the details of HTTP requests and responses. This standard allows a complex web server to include a variety of Python tools and frameworks that are fitted together...