the local_settings.py trick isn't really necessary for any Django
project including Satchmo, you can move all the from a
local_settings.py file into your settings.py file. But the purpose of
the local_settings.py in regards to deployment (in my understanding)
is as follows:

The settings.py file contains all of your "generic" application
settings. What are "generic" settings you ask? Good question! These
are settings that are going to be the same for your application
regardless of what computer you run it on. For example, the
INSTALLED_APPS settings will be the same regardless of weather or not
the program is running on your computer, my computer, or a WebFaction
VPS.

Note: In my settings.py file, I also include the settings for my
deployment environment. For example, I store the database credentials
for my production server. Why do I do this? Because the settings.py
file is versioned in my source control program.

Now onto local_settings.py....

At the bottom of your settings.py you have the lines (or something
similar):
try:
   from local_settings.py import *
except:
   pass

What this does it attempt to load a file called local_settings.py. If
the file doesn't exist or has an error, it ignores the file and
continues to run with the "default" settings specified in settings.py
(in my case they are my production server settings). So what goes in
local_settings.py? Well as the name suggests, you put in your "local"
settings. This file would not be versioned.

So for an example:

You build an app called "FaceBook" (yeah it's never been done!).
Anyways... you check your source into a googleCode repository and I
download it apply a few bug fixes. So how do I make it run on my
computer? Well I set up my database on my computer and have 2 choices
to get your app to connect to my database.

1.) I can edit the settings.py file and alter the database settings to
my local computer. This works fine, but what happens if I check that
file in? Now the world knows my local database settings, and whatever
the settings were are now lost.

2.) In otpion 2, I leave settings.py untouched. I create a
local_settings.py file in the same directory. In the local_settings.py
file I put in any settings that I want to override from settings.py
This way my settings are "my" settings and wont' be versioned.


And now back to Satchmo land....

Satchmo 0.8.1 used a local_settings.py by default. You can remove the
need for this by pretty much copying everything from local_settings.py
into settings.py. Just be mindful of duplicated settings since
local_settings.py was meant to override settings.py.

In Satchmo trunk, the "need" for a local_settings.py was pretty much
removed, although I think 'most' Django developers use this method to
separate development from production environments.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to