Section 16.1.

16.1. "Oh What a Tangled Web We Weave"

This chapter is the fourth part of our look at Python Internet programming. In the last three chapters, we explored sockets and basic client-side programming interfaces such as FTP and email. In this chapter, our main focus will be on writing server-side scripts in Pythona type of program usually referred to as CGI scripts. Server-side scripting and its derivatives are at the heart of much of the interaction that happens on the Web.

As we'll see, Python is an ideal language for writing scripts to implement and customize web sites, due to both its ease of use and its library support. In the following chapter, we will use the basics we learn in this chapter to implement a full-blown web site. After that, we will wrap up this part of the book with a chapter that looks at other Internet-related topics and technologies. Here, our goal is to understand the fundamentals of server-side scripting, before exploring systems that build upon that basic model.

A House upon the Sand

As you read the next two chapters of this book, please keep in mind that they focus on the fundamentals of server-side scripting and are intended only as an introduction to programming in this domain with Python. The web domain is large and complex, changes constantly, and often prescribes many ways to accomplish a given goalsome of which can vary from browser to browser and server to server.

For instance, the password encryption scheme of the next chapter may be unnecessary under certain scenarios (with a suitable server, we could use secure HTTP instead). Moreover, some of the HTML we'll use here may not leverage all of that language's power, and may not conform to current HTML standards. In fact, much of the material added for the third edition reflects recent technology shifts in this domain.

Given such a large and dynamic field, this part of the book does not even pretend to be a complete look at the server-side scripting field. That is, you should not take this text to be a final word on the subject. To become truly proficient in this area, you should study other texts for additional webmaster-y details and techniquesfor example, Chuck Musciano and Bill Kennedy's HTML & XHTML: The Definitive Guide (O'Reilly).

The good news is that here you will explore the core ideas behind server-side programming, meet Python's CGI tool set, and learn enough to start writing substantial web sites of your own in Python. This knowledge should apply to wherever the Web or you head next.

Programming Python
Programming Python
ISBN: 0596009259
EAN: 2147483647
Year: 2004
Pages: 270
Authors: Mark Lutz © 2008-2017.
If you may any questions please contact us: