Implementing the DISTAL application
Now that we have the data, we can start to implement the DISTAL application itself. To keep things simple, we will use CGI scripts to implement the user interface.
Note
CGI scripts aren't the only way we could implement the DISTAL application. Other possible approaches include using web application frameworks such as TurboGears or Django, using AJAX to write your own dynamic web application, using CherryPy (http://cherrypy.org) or even using tools such as Pyjamas (http://pyjs.org) to compile Python code into JavaScript. All of these approaches, however, are more complicated than CGI, and we will be making use of CGI scripts in this chapter to keep the code as straightforward as possible.
Let's take a look at how our CGI scripts will implement the DISTAL application's workflow:
As you can see, there are three separate CGI scripts, selectCountry.py
, selectArea.py
, and
showResults.py
, each implementing a distinct part of the DISTAL application.
Tip
What is a CGI...