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/08/25 10:44]
jodal Document the improved inner workings of nav.django.urls.
devel:django_introduction [2008/08/28 10:09]
morten fix details of sessions
Line 117: Line 117:
 ==== mod_python and Django sessions ==== ==== mod_python and Django sessions ====
  
-NAV uses sessions for keeping track of logged in users. Currently, we are not using ''​django.contrib.sessions'',​ but are still using plain old ''​mod_python'' ​sessions. For now, the easiest way to get hold of the ''​mod_python'' ​session in views is to use ''​request._req.session'',​ where ''​request._req''​ is the traditional ''​mod_python''​ request object. In the future, one should look into using Django'​s authentication and session frameworks.+NAV uses sessions for keeping track of logged in users. Currently, we are not using ''​django.contrib.sessions'',​ but are still using a session library developed specifically for NAV.  This session library attaches session objects to ''​mod_python''​'s request objects For now, the easiest way to get hold of the NAV session in views is to use ''​request._req.session'',​ where ''​request._req''​ is the traditional ''​mod_python''​ request object. In the future, one should look into using Django'​s authentication and session frameworks.
  
 ==== Base template using Django templates ==== ==== Base template using Django templates ====
Line 126: Line 126:
  
 NAV should certainly start using unit testing. Tests for i.e. ''​nav.web.ipdevinfo''​ could for example go into ''​nav.web.ipdevinfo.tests'',​ but this should be synchronized with Django conventions,​ and one must also find a way to run the tests, most probably through a custom test runner or something. The point is, one needs to give this some thought, and the sooner the better. New Django apps in NAV should really have unit tests from the start. NAV should certainly start using unit testing. Tests for i.e. ''​nav.web.ipdevinfo''​ could for example go into ''​nav.web.ipdevinfo.tests'',​ but this should be synchronized with Django conventions,​ and one must also find a way to run the tests, most probably through a custom test runner or something. The point is, one needs to give this some thought, and the sooner the better. New Django apps in NAV should really have unit tests from the start.
 +
devel/django_introduction.txt ยท Last modified: 2010/01/13 11:30 by eide