A Developer Guide for Reuse and Further Development
The system can be downloaded here; further development of the system and additional information can be found here. The download includes a minimal example edition. An overview of the system and a description how to run the system is provided by the editor guide right at the beginning. This guide briefly mentions the folder code/python, which contains the templates and the code of the system: The subfolder example contains the templates and the code specific for the application you have downloaded; the parent folder contains generic templates and code to be used by several applications. You can add folders next to example for further specific applications.
Templates are located in a folder views within the specific folder or within the parent folder python. The template named base.tpl generates the whole page except from the element main. This element is generated by one of the other templates and then filled into the basic template. Every template starts with a comment describing the purpose and referring to an example page in the example edition.
The python files contain the code that starts the application, routes requests, fetches data and passes the data in the template. The controler and main module is the file portal.py, the routes are specified in routes.py, the access to the data is provided by dao.py. In these three cases, the example app uses the generic variants in the parent folder. The other files contain code used within portal.py, routes.py or dao_io.py. The classes and functions (and methods) of any used module are extensively documented by docstrings within the module. The docstrings are written in reStructuredText.
To explore the code systematically, one may start with the file start_on_localhost.py in example and proceed with the function called there, namely main in python/portal.py. The start file specifies the basic parameters of the system. In production, you have to change host
to the ip address of your server, port
to 80
, debug
to False
and server
to e.g. 'cherrypy'
, for which cherrypy must have been installed.