Writing views and templates for Dingos¶
Contents
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 foldertemplates\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/
.
Supporting Documentation¶
- For basics on templates, refer to the Django documentation on the template language.
- In order to learn how to use the Django Grappelli CSS, make sure to include
(r'^grappelli/', include('grappelli.urls'))
in your url patterns inurl.py
. You can then view the Grappelli CSS documentation under<your Django server url>/grappelli/grp-doc/
. - For information on class-based views see: - Django documentation on class-based views - Django documentation on using mixins in class-based views
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