Writing views and templates for Dingos

Relevant folders and files

Templates

DINGOS uses Django templates (see Django documentation on the template language) for rendering HTML pages. These are located in the template\dingos\grappelli folder. The reason for this nesting is the following:

  • by having dingos in the file path, also other apps are able to refer to templates defined in DINGOS
  • by having grappelli in the file path, we are open to supporting different CSS frameworks at a later point of time: for supporting, e.g., bootstrap, a folder templates\bootstrap would have to be added and would then contain the bootstrap-based templates.

In order to learn how to use the Django Grappelli CSS, make sure to include (r'^grappelli/', include('grappelli.urls')) in your url patterns in url.py. You can then view the Grappelli CSS documentation under <your Django server url>/grappelli/grp-doc/.

Views

DINGOS makes extensive use of Django’s class-based views. In view_classes.py, we define mixins and base classes that are used for defining views in DINGOS; the views themselves are defined in views.py.

Supporting Documentation

Dingos-specific features

User configurations

Since Dingos 0.2.0, Dingos offers resources for structured management of user-specific data such as user-configurations. Please refer to Dingos User Configuration Facilities for more information.

Tips and tricks

When writing and testing views, do not even start without the excellent Django Debug Toolbar: it shows you, for example, how many which SQL queries were executed (which will help you to find the right configuration for the prefetch_related and select_related