#12493: settings.configure silently allows TEMPLATE_DIRS configuration error
---------------------------------------------+------------------------------
          Reporter:  mckoss                  |         Owner:  nobody           
  
            Status:  new                     |     Milestone:                   
  
         Component:  Core framework          |       Version:  1.1              
  
        Resolution:                          |      Keywords:  settings, 
templates
             Stage:  Design decision needed  |     Has_patch:  0                
  
        Needs_docs:  0                       |   Needs_tests:  0                
  
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by lukeplant):

 I agree with Alex - fixing them automatically is pretty nasty, because it
 means that developer is not alerted about their error.  If they set
 `TEMPLATE_DIRS` incorrectly in their settings.py, and use the value
 somewhere else (e.g. as part of another setting, or in some other code),
 the possible consequences violate the principle of least astonishment.
 Throwing a validation error would have been much better IMO.

 I'm also not convinced the error is that inscrutable.  In the normal case,
 you get a debug page with the error `TemplateDoesNotExist`.  The
 `TEMPLATE_DIRS` setting, which is the obvious thing to check, is displayed
 at the bottom of the page, and will show a single string — and I think it
 ought to be fairly obvious from the plural name `TEMPLATE_DIRS` that the
 setting should be an iterable of some kind.

 In the context of a settings file, you are dealing with people who might
 not know Python, and the need for the trailing comma in a one-tuple is
 quite an obscure syntax point to expect non-Python developers to know.
 That argument isn't so strong for normal Python code.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12493#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to