On 08/07/06 20:35, Michael Radziej wrote:
> Steven Armstrong wrote:
> 
>> Why not just create a second settings file, call it settings_local.py or 
>> whatever, and at the end of settings.py do something like:
>> 
>> from settings_local import *
> 
> Well (apart from Adrian has put out his word now ...), my problem
> was that I had to build a debian package for my app, and the
> settings file should go somewhere below /etc and will be edited
> by the sysadmins. But your approach is perfectly valid if you
> don't have these constraints.
> 

Had a similar problem lately and ended up doing this:

cat /usr/lib/python2.4/site-packages/phc/settings.py
import sys
import imp

mysettings = imp.load_source('phc_settings', '/etc/phc/config.py')
for k in dir(mysettings):
   if k.isupper():
     #print '%s = %s' % (k, getattr(mysettings, k, None))
     setattr(sys.modules[__name__], k, getattr(mysettings, k, None))

del mysettings
del sys.modules['phc_settings']


A bit hackisch, but it works :)

Looking at it again a symlink would have also done the job. Oh well ...

> Probably another example that everybody has different needs here.
> 
> Michael
> 
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to