That's just interesting. I've never seen the use of `execfile()` before. We use 
a devsettings.py and use it to override an individual server or local settings, 
and then on the live/deployed server, no devsettings.py is even included. Hence 
the try...except wrapped around it. It's a nice little pattern that gets us by, 
but yes, things like this do show that there needs to be one overall 
"recommended" method for maintaining separate settings on a per 
server/environment basis.

On Mar 22, 2011, at 7:05 PM, Ian Kelly wrote:

> On Tue, Mar 22, 2011 at 4:49 PM, Matt Robenolt
> <youdontevenk...@gmail.com> wrote:
>> Why not just do an import for your custom settings?
>> 
>> try:
>>        from site_settings import *
>> except ImportError:
>>        pass
> 
> No particularly compelling reason that I know of, the import machinery
> is just unnecessary in this case.  The site_settings.py is viewed as
> an extension of the settings.py, so it doesn't need to be loaded as a
> module in its own right.  And for the same reason we know exactly
> where we expect the file to be, so there's no need to consult
> sys.path.
> 
> I suppose it just comes down to a matter of taste.
> 
> Cheers,
> Ian
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-developers?hl=en.
> 

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

Reply via email to