Friday, March 29, 2013

Re: How to manage django settings.py for Github, local, production

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJRVW6dAAoJEFjlhRo+xFTEPTIP/3nLwNRjzST5kx5CFLutBb+w
Z5kk1mT/9JsWR3ECAy6LgbrXH890+aF704Ck3n1ztF7tkY9uVqm8z88Xz3QkhQXd
9Kdr/TSXdUdqUaS79D4aHK9w6WPaaqrn/4JisRtgFcyEJqXshsrFlZZEdpq0eySw
fDVvGYLXiCtgabKND4T5BDzGgD/LWoo6EX0CIfhGc51CCYglTEzFcS6SmVkp8Dx0
Vj3zWjczLvujLmOCZLovjzzjT+gn3JZe70BXmj4TVO6tlXXkqHXap3VjP5tbuKiz
e6auz76Imi4/LDbVxT5GFqEa2QeDhSnwAigmH+55JMbQ+eR0W+b7ORC6eI1fOwTB
8TK8eiE3QRGuQidylZfuYMOJ1Gs6+NMc/ZTYTHa2MVTyjFRfPQH+yc3r2WW92B2f
X2H4waGab/s0cLtCOwFsePCmpsdWIXUPVxmphgr+nHvAU5tXIh/jVEYvfwcNfhzd
ZYZTkNCYs/sskIr/MFF7idmdX+utctvE6lYdF7O2fnrpiyZYPiamVK20pDrXUe/N
wYVD+vEnVaudafpm29dp6zfTE2VUDPQ4dYS/0+wFYlullDiOT6tdg6F1IqqNP25p
ieunE4gReskhq7R/qvlnJUUmCIMpmabYtle+bsv8X/JkEb+AwoZVF0O3dtaMvclH
ICMFXC9Lpqt2wjwInaiV
=tdcu
-----END PGP SIGNATURE-----
On Fri, 29 Mar 2013 00:40:12 -0700 (PDT)
surya <kasturisurya@gmail.com> wrote:

> In our project, as its opensource, the master branch can't be
> directly pushed into Production server as it contains confidential
> settings.. For that I (admin of server) created a local branch to
> specifically contain production settings using local_settings.py..
> The master is merged as into this branch as soon as we release new
> feature/ fix bug etc.. (any better way of handling. please tell me)

Well, one interesting concept I've see is from the Two Scoops of Django
(I join the minions on this group that recommend this book - probably
one of the best buys in my life) - the authors use separate
configuration files for production, test, development (even
per-developer settings), storing all of them in the repo, _but_ they
don't store any confidential data in those files.

Instead of that they use environment variables to make the passwords
available to user running the code, and then inside of "base"
settings.py they use a bit of Python code to read them and assign them
to appropriate variables.

There's probably a couple of variations on this as well - for example
storing path to file containing the password in environment variable,
and then reading from there etc.

Best regards

--
Branko Majic
Jabber: branko@majic.rs
Please use only Free formats when sending attachments to me.

Бранко Мајић
Џабер: branko@majic.rs
Молим вас да додатке шаљете искључиво у слободним форматима.

No comments:

Post a Comment