One solution is to add an extra import at the bottom of your  
settings.py:

try:
     from localsettings import *
except ImportError:
     pass

Then put localsettings.py in your svn:ignore, and override whatever  
settings you need to on a per-installation basis.

On Jul 24, 2007, at 8:41 AM, gorans wrote:
> I develop Django sites on my mac and then publish them to another web
> server. In between, they live in a happy SVN repository on my
> development server.
>
> Each time I make a change to the project's settings.py I have to then
> go over and modify the live file version (in respect to the database
> type / name, media directory etc.)
>
> I though that there could be a way to trick Django into reading
> special development settings for me, something like having a settings
> 'package' import separate settings files:
>
> e.g.
>
> myproject/
>
>     manage.py
>     ...
>     settings/
>         __init__.py
>         coresettings.py
>         localsettings.py
>
> so that we use the variable from coresettings first, and then try:
> import localsettings and if successful use those subsequent values.
>
> That way, I can have an un-versioned localsettings.py living on my
> mac, whilst keeping the live settings intact. Additionally, other
> developers on the project can do the same!
>
> Is this possible? (I'm sure it is but my Python just isn't good enough
> to know how to import all the variables from each module)
>
> Can anyone please give me directions / pointers as to how to do this?
> Or alternatively, how you deal with this task.
>
> Your help is very very much appreciated
>
> cheers
>
> Goran
>
>
> >


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

Reply via email to