python web applications


  • The main advantage of making a program available on the Web is that it can reach more users without the need for them to install a copy of the program and to have a Python installation.
  • It also helps users who do not have the permissions necessary to install software on a particular machine. Sometimes the program accesses huge databases that can’t be installed on the end user’s hard drive.
  • In order to make web programming it is not enough to know Python.
  • It is also necessary to have a basic understanding of Web servers and Web page design using HTML. Both of these topics are beyond the scope of this book, for which reason I recommend that you read up on them if you have never designed a WEB page before.
  • Knowing the basics of HTML has special importance as most IT Labs have staff dedicated to the setup and maintenance of the WEB server but the HTML design is something that they will rarely do for you.
  • There are several ways to use Python on a Web server, CGI (Common Gateway Interface), mod python and WSGI (Web Server Gateway Interface).
  • CGI is the most used method, as it is the easiest to configure and is available on almost all Web servers without having to install additional software
  • It is essentially a protocol to connect an application, written in any language with a Web server.
  • mod python in particular consists of an Apache Module that integrates Python with the Web server.
  • The advantage of this approach is the fast execution time of our scripts, since the Python interpreter is loaded with the Web server.
  • WSGI, in turn, is a “specification for Web servers and application servers to communicate with Web applications.”
  • The main advantage of WSGI is that once you have made a WSGI application, it can be deployed in any WSGI compatible server (or even using a Python provided Web server).