Foundations of Python Network Programming
Chapter 10 ■ http ServerS 180 In the absence of a framework, your code must do all of the negative work of determining which hos ...
Chapter 10 ■ http ServerS 181 Less popular than WebOb for pure WSGI coding but also supported by a loyal fan base is Armin Ronac ...
Chapter 10 ■ http ServerS 182 Summary Python has an http.server module built in that, when launched from the command line, serve ...
183 Chapter 11 The World Wide Web Chapters 9 and 10 explained the Hypertext Transfer Protocol (HTTP) as a general mechanism by w ...
Chapter 11 ■ the World Wide Web 184 This syntax can be used for more general purposes than describing material to be fetched fro ...
Chapter 11 ■ the World Wide Web 185 The “network location” netloc can have several subordinate pieces, but they are uncommon eno ...
Chapter 11 ■ the World Wide Web 186 from urllib.parse import quote, urlencode, urlunsplit urlunsplit(('http', 'example.com', ...
Chapter 11 ■ the World Wide Web 187 The argument order of urljoin() is the same as that of os.path.join(). First provide the bas ...
Chapter 11 ■ the World Wide Web 188 The Hypertext Markup Language There are shelves of books about the core document formats tha ...
Chapter 11 ■ the World Wide Web 189 Or the designer might reason that there is only one purpose that an could have inside of on ...
Chapter 11 ■ the World Wide Web 190 And while in the inspector, you can switch to a Network tab that will show you all of the ot ...
Chapter 11 ■ the World Wide Web 191 Reading and Writing to a Database Imagine a simple bank application that wants to allow acco ...
Chapter 11 ■ the World Wide Web 192 The schema is overly simple—the bare minimum needed to get this application running. In real ...
Chapter 11 ■ the World Wide Web 193 app = Flask(name) get = Environment(loader=PackageLoader(name, 'templates')).get_template @a ...
Chapter 11 ■ the World Wide Web 194 Not only is the listing dangerous, but it is also vulnerable to many of the most important a ...
Chapter 11 ■ the World Wide Web 195 Listing 11-3. The base.html Page Jinja2 Template {% block title %}{% endblock %} {{ sel ...
Chapter 11 ■ the World Wide Web 196 {% for p in payments %} {% set prep = 'from' if (p.credit == username) else 'to' %} {% set ...
Chapter 11 ■ the World Wide Web 197 With debug mode turned on (see the second-to-last line of Listing 11-2), Flask will even res ...
Chapter 11 ■ the World Wide Web 198 When this HTML form is submitted, the browser places the data into the body of the request i ...
Chapter 11 ■ the World Wide Web 199 When Forms Use Wrong Methods Web applications that misuse HTTP methods cause problems with a ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf