[BangPypers] Maintaining dev and prod env alike

Vineet Naik naikvin at gmail.com
Sun Mar 25 13:38:43 CEST 2012


I keep a file devsettings.py alongside settings.py and add environment
specific config in it.

Then inside settings.py, devsettings is imported and all those
settings are taken from there

devsettings.py is ignored by git but so that you don't lose any
settings and to make sharing of this file with other
contributors easy, maintain a file devsettings.py.sample which is
tracked by git.

Whenever a new setting is added in devsettings, it should also go into
the sample file.


On Sun, Mar 25, 2012 at 4:55 PM, kracethekingmaker
<kracethekingmaker at gmail.com> wrote:
> hi
>
>>> Hi
>>>
>>>  I am using git. I do dev in my localhost and prod env is my web
>>> server, I don't have test env. My issue is my model has db params, so
>>> param are different in both env, so every time I pull and change db
>>> param, I dont think so this is encouraged, though this has nothing to
>>> do with python, but most people out here must have faced similar
>>> situation, kindly let me know best practices.
>>
>> You should probably keep a -dev settings file which can override the
>> server parameters (or vice versa). This shouldn be as small as possible
>> and should be ignored by git.
>
> Mean config.py ignored by git and have sample_config.py bare bone skeleton?
>
>
>
> --
> "Talk is cheap, show me the code" -- Linus Torvalds
> Regards
> Kracekumar.R
> www.kracekumar.com
>
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers



-- 
Vineet Naik


More information about the BangPypers mailing list