User Tools

Site Tools


devel:django_introduction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
devel:django_introduction [2008/08/28 10:52]
morten fix typos
devel:django_introduction [2008/09/24 09:16]
jodal Document recommended file structure for static media specific to an app.
Line 24: Line 24:
 === nav.django.urls.urlbuilder === === nav.django.urls.urlbuilder ===
  
-There is one special submodule named ''​nav.django.urls.urlbuilder''​. This is simply a Django replacement for the archaic ''​nav.web.urlbuilder''​. It is used by Django apps to link to non-Django apps, like the report subsystem, through the use of the ''​url''​ template tag or the ''​reverse()''​ function, instead of using the archaic ''​nav.web.urlbuilder''​. From your code's point of view, the URL configurations in ''​nav.django.urls.urlbuilder''​ is used as any other URL configuration in NAV.+There is one special submodule named ''​nav.django.urls.urlbuilder''​. This is simply a Django replacement for the archaic ''​nav.web.urlbuilder''​. It is used by Django apps to link to non-Django apps, like the report subsystem, through the use of the ''​url''​ template tag or the ''​reverse()''​ function, instead of using the archaic ''​nav.web.urlbuilder''​. From your code's point of view, the URL configurations in ''​nav.django.urls.urlbuilder''​ is used as any other Django ​URL configuration in NAV.
  
 ==== Shortcuts ==== ==== Shortcuts ====
Line 85: Line 85:
  
 Further, the file ''​ipdevinfo.tool''​ defines the name, description,​ icon and URL of the IP Device Info tool in NAV's toolbox. The file ''​htaccess''​ is the only file which is installed into the ''​ipdevinfo/''​ folder in the web server'​s document root. It simply states that all URLs starting with ''​http://​nav.example.com/​ipdevinfo/''​ are to be handled by a Python program, namely Django'​s mod_python handler, using ''​nav.django.settings''​ as configuration. In other words, the htaccess file should be identical for all Django apps in NAV. Further, the file ''​ipdevinfo.tool''​ defines the name, description,​ icon and URL of the IP Device Info tool in NAV's toolbox. The file ''​htaccess''​ is the only file which is installed into the ''​ipdevinfo/''​ folder in the web server'​s document root. It simply states that all URLs starting with ''​http://​nav.example.com/​ipdevinfo/''​ are to be handled by a Python program, namely Django'​s mod_python handler, using ''​nav.django.settings''​ as configuration. In other words, the htaccess file should be identical for all Django apps in NAV.
 +
 +Finally, the folder ''​media/''​ contains all static media which is needed by the app. Typically, this should be ''​media/​style/''​ for CSS-files, ''​media/​js/''​ for JavaScript, and ''​media/​images/''​ for images. Files should typically be named after the app to avoid name collisions with other apps when installed, i.e. ''​media/​style/​ipdevinfo.css''​ and subfolders like ''​media/​images/​ipdevinfo/''​.
  
 How to install everything mentioned here is defined in ''​Makefile.in''​. How to install everything mentioned here is defined in ''​Makefile.in''​.
devel/django_introduction.txt ยท Last modified: 2010/01/13 11:30 by eide