I've tried a few different strategies and found this method works best for me.
In my fabfile I have environment 'setters' that precede regular commands. So I can do 'fab qa deploy' or 'fab prod deploy' and the deploy command grabs the correct settings_local file for the target environment.
I typically use this set up:
- settings.py contains global settings that aren't effected by deployment level.
- at the bottom of that file you have
- in settings_local.py you have your deployment level dependent settings- then just git ignore settings_local.py