On Sat, Mar 7, 2009 at 8:14 AM, kbochert <[email protected]> wrote:

>
> Can anyone explain to me the use of having 2 settings files -
> settings.py and local_settings.py?
>
> What settings go in which file?
>
> Why are many things set in BOTH files (DRY)?
>
> Why does settings import local_settings (thereby hiding the
> definitions in settings from local_settings), rather than the other
> way around.
>

It facilitates an easier dev/test/deploy cycle.  Generally, you'll have
slightly different settings on your development machine from the production
machine.  So, if you put the useful-only-to-one-machine settings in the
local file, and you exclude that file from version control, you'll never
accidentally overwrite the settings on one machine with another.

Trust me, I've done it, and it is awkward. It usually happens in the middle
of a deployment, and makes you look like an idiot.

The local file is after the "global" settings file because it is *supposed
to* hide the variables in that file.  That way, you can specify exactly the
right settings for a particular machine.  The settings are repeated mostly
for documentation purposes, and for completeness sake.

Make more sense?  You are absolutely free to simply put everything in
settings.py and ignore local_settings, it is simply a helper based on
experience.  There are other ways to do it, I've seen them discussed on the
Django wiki, this is just - in my opinion - the most obvious and foolproof.

---
Bruce Kroeze
http://gosatchmo.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" 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/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

  • Settings kbochert
    • Re: Settings Bruce Kroeze

Reply via email to