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 Both sides next revision
devel:django_introduction [2008/09/24 09:16]
jodal Document recommended file structure for static media specific to an app.
devel:django_introduction [2008/09/24 09:25]
jodal It is now recommended to keep the nav.django.urls.* modules in the various subsystems instead of in lib-python.
Line 20: Line 20:
 In ''​nav.django.urls''​ the root URL configuration for all things Django in NAV is located. ''​nav.django.urls''​ is not only a module, but also a package. The ''​%%__init__.py%%''​ file in the package imports all submodules it can find in the file system, calls ''​get_urlpatterns()''​ on all the submodules, and combines the results into one ''​urlpatterns''​ list, as all Django URL configurations does. In ''​nav.django.urls''​ the root URL configuration for all things Django in NAV is located. ''​nav.django.urls''​ is not only a module, but also a package. The ''​%%__init__.py%%''​ file in the package imports all submodules it can find in the file system, calls ''​get_urlpatterns()''​ on all the submodules, and combines the results into one ''​urlpatterns''​ list, as all Django URL configurations does.
  
-In other words, when creating a new Django app in a branch of its ownyou simply drop a new submodule for your app into the ''​subsystem/​lib-python/​src/​nav/​django/​urls/''​ folder, run ''​make install''​ in ''​subsystem/​lib-python/​''​ and then the NAV installation will find your app. If somebody else runs ''​make install''​ in their version of ''​subsystem/​lib-python/​''​ they will not overwrite ​the URL configuration for your new app, unless they use exactly the same name for the submodule as you did.+When creating a new Django app, create ​a new submodule for your app in the ''​subsystem/​your_app/​nav/​django/​urls/''​ folder, run ''​make install''​ in your app to install the module into the ''​nav.django.urls'' ​package, ​and the NAV installation will find your app. If somebody else installs URLconf glue into ''​nav.django.urls''​ they will not affect ​the URL configuration for your app, unless they use exactly the same name for the submodule as you did. For details, check out the ''​ipdevinfo''​ subsystem and its ''​Makefile.in''​.
  
 === nav.django.urls.urlbuilder === === nav.django.urls.urlbuilder ===
devel/django_introduction.txt ยท Last modified: 2010/01/13 11:30 by eide