CHAPTER 7

image

Handling HTTP

The Hypertext Transfer Protocol (HTTP) is the fundamental language for communication over the Web. It’s spoken by both Web servers and Web browsers, along with a variety of specialty tools for dealing with the Web.

The Python community has done a tremendous amount of work to standardize the behavior of applications that interact with HTTP, culminating in PEP-333,1 the Web Server Gateway Interface (WSGI). Since Django follows the WSGI specification, many of the details listed in this chapter are a direct result of compliance with PEP-333.

Requests and Responses

Because HTTP is a stateless protocol, at its heart is the notion ...

Get Pro Django, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.