Version 7 (modified by Fran Boon, 12 years ago) ( diff )



Sahana Eden Essential Guide

Have a look at the Sahana Eden Essential Guide Book and follow the tutorial chapters:



MVC Architecture


Defines databases in: /modules/models/*

The Models are loaded 1st within Web2Py processing, before the controllers.
So you can import any global modules/set any global variables here.
The Models are imported in alphabetical order, so we load the files which other modules depend on 1st, hence naming them appropriately:,,, etc


HTML/Javascript templates in /views/*

  • these are normal HTML/JS files with the ability to add in Python code (e.g. variables) surrounded by brackets: {{ interpreted python here }}
  • there should be an .html file available for each function in the module (name normally being the same as the function)
  • these normally inherit from views/layout.html which also includes the JavaScript from views/*_ajax.html
  • if there is no view defined then a default view will be displayed, which will show the values of all the data it can see, but not be formatted nicely


Python functions in /controllers/

   def list_records():
       items =
       return dict(items=items)

Static CSS/Javascript files are stored in /static

Note: See TracWiki for help on using the wiki.