We will now return to the web application developed in Chapter 5, Mission-Critical MongoDB Database Tasks. To keep things simple, we add a new web action script, /path/to/repo/www/chapter_06/history.py, which presents a paginated list of a customer's purchase history using the classes and methods described previously.Â
As we are following the action-domain-responder software design pattern, mentioned briefly in the previous chapter, you need to understand that the web scripts represent the action component. These scripts intercept web requests, consult with the domain service, and use the responder to produce output. Refer to https://github.com/pmjones/adr.
As with the other scripts, we import the classes described in the previous chapter, the web.responder.html.Html class, as well as web.auth.SimpleAuth. The cgitb Python module is used to display errors and should be removed from a live server:
#!/usr/bin/python
import os,sys
src_path...