#3687: django.conf.settings reads DJANGO_SETTINGS_MODULE at import time
--------------------------------------+-------------------------------------
   Reporter:  [EMAIL PROTECTED]  |                Owner:  adrian         
     Status:  new                     |            Component:  Template system
    Version:  0.95                    |           Resolution:                 
   Keywords:                          |                Stage:  Unreviewed     
  Has_patch:  0                       |           Needs_docs:  0              
Needs_tests:  0                       |   Needs_better_patch:  0              
--------------------------------------+-------------------------------------
Comment (by mtredinnick):

 Hmmm. That's a little unexpected. I thought that used to work.
 
 For anybody looking at this...
 
 There are some places where an import forces a setting to be accessed, but
 they shouldn't be very common. We  have moved a lot of settings accesses
 out of default arguments in functions for just that reason. For example,
 have a lok at how we set up the default arguments in
 {{{django.templates.loaders.filesystem.get_template_sources()}}} -- we
 ensure settings is not accessed at import time. Ideally, imports should be
 safe from accessing settings, but executing any code at all means all bets
 are off.
 
 In the interim, the workaround in Johan's previous comment is required.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3687#comment:3>
Django Code <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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to