5 Python on the Web

WHAT YOU WILL LEARN IN THIS CHAPTER:    

  • Understanding how Python works on the web
  • Creating a web app with Python
  • Connecting a web app to a database
  • Creating an API
  • Parsing and manipulating data in a web app

WROX.COM DOWNLOADS FOR THIS CHAPTER

For this chapter the wrox.com code downloads are found at www.wrox.com/go/pythonprojects on the Download Code tab. The code is in the Chapter 5 download, called Chapter5.zip, and individually named according to the names throughout the chapter.

Up to this point you’ve been using Python locally to investigate and parse data on your local machine. But what about when you want to use Python for remote data manipulation, or across “the wire”?

Python is a very powerful language, and it’s not just for doing system administration tasks or file system tasks locally. You can use Python across networks to handle tasks using REST and XMLRPC. This chapter looks into both of these, but the focus is on the most popular method of using Python remotely: HTTP using REST.

In this chapter you use some of the more popular web technologies with Python, including HTTP and REST, to create a web app that links to a database. You use technologies such as Flask and SQLite to complete the web app, and finally, you create an application programming interface (API) and learn to parse and manipulate data in the web app.

REST stands for Representational State Transfer. It’s a fancy name for the technology and architecture style of a certain web ...

Get Python Projects 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.