What is the recommended way of handling settings for local development and the production server? Some of them (like constants, etc) can be changed/accessed in both, but s
In order to use different settings
configuration on different environment, create different settings file. And in your deployment script, start the server using --settings=
Benefits of using this approach:
Your settings will be modular based on each environment
You may import the master_settings.py
containing the base configuration in the environmnet_configuration.py
and override the values that you want to change in that environment.
If you have huge team, each developer may have their own local_settings.py
which they can add to the code repository without any risk of modifying the server configuration. You can add these local settings to .gitnore
if you use git or .hginore
if you Mercurial for Version Control (or any other). That way local settings won't even be the part of actual code base keeping it clean.