Web page generation =================== Dynamic html generation ----------------------- The creation of web pages builds on the capabilities of the Python Flask and jinja libraries. The handlers for each webpage are typically within the views.py scripts in various directories of entero, with each directory relating to the different broad areas of enterobase functionaility. The handlers are prefixed with the @XXXX.route prefix, such as: .. code-block:: python @main.route('/') def index(): where XXXX corresponds to the different groups of URLs such as main, species etc, and where the handlers are then found in the XXXX/views.py python scripts. The prefixes indicate to flask which handlers to use for which URLs. The html pages are then rendered using code such as: .. code-block:: python db_info = format_db_info(db_info) return render_template('index.html',db_info=db_info, total_strains = total_strains, help = app.config['WIKI_BASE']) which takes the fixed template html file from entero/templates directory and makes appropriate substitutions before returning the completed webpage to the client for display. The templates are a mixture of html, embedded python which is executed during the process of generating the web page,(enclosed in {% ... %} ) and tags for substitution (enclosed in {{...}}) as in the following example, where the db_info python array passed into render_template is cycled through creating a new block of html populated with the contents (rec['name'] etc) .. code-block:: {% for rec in db_info %}