[Answered ]-How do you manage production websites and settings with GIT?

2đź‘Ť

Commit an example settings.py file to the repository (eg: settings.py.example) then copy and edit with the real hostname for each deployment – trying to detect things like hostname, pathnames, etc can get messy fast imho.

New deployments won’t clobber it since it’s not in the repository, but you’ll probably tell git to ignore the “settings.py” itself so you don’t commit a development setting file by accident.

👤John Mee

0đź‘Ť

I have tinkered with Silk Deployment which is a Python toolkit based around Fabric that uses Git to synchronize configurations on deployments. It is intended for use with Django and it is very, very cool. Well worth a look!

👤jathanism

Leave a comment