Learning Python Network Programming

(Sean Pound) #1

Applications for the Web


In Chapter 2, HTTP and Working with the Web, we explored the HTTP protocol—the
primary protocol used by the World Wide Web—and we learned how to use Python
as an HTTP client. In Chapter 3, APIs in Action, we expanded on this and looked at
ways to consume web APIs. In this chapter, we'll be turning our focus around and
looking at how we can use Python to build applications that serve responses to
HTTP requests.


In this chapter, we'll cover the following:



  • Python web frameworks

  • A Python web application

  • Hosting Python and WSGI


I should note up front that hosting modern web applications is a very large topic,
and a complete treatment is well beyond the scope of this book, where we're focusing
on applying Python code to network problems. Topics such as database access,
selecting and configuring load balancers and reverse-proxies, containerization,
and the system administration techniques needed to keep the whole show up and
running won't be covered here. There are many great resources online though that
can give you a start, and we'll try to mention as many as we can where relevant,
as we go along.


Having said that, the technologies listed above aren't a requirement for creating
and serving Python-based web applications, they're simply what a service comes
to require as it reaches scale. As we'll see, there are options for easily manageable
small-scale application hosting too.

Free download pdf