On Mon, Sep 29, 2014 at 2:15 PM, Alejandro Varas G.
<
alej0varas@gmail.com> wrote:
> Hi Thomas,
>
> El 29/09/2014 10:05, "Thomas Güttler" <
hv@tbz-pariv.de> escribió:
>>
>> Hi,
>>
>> of course we separate data from code:
>>
>> - code belongs into version control (git)
>> - data belongs into a database (postgres)
>>
>> But where does configuration belong?
>
> "To the environment"
>
> A good practice is to place config in the environment[0] and load it from
> code.
>
> 0 -
http://12factor.net/config
>
I don't want to start a holy war, but I 100% disagree with putting
configuration in to the environment.
First of all, how does it get in the environment in the first place?
You must write a shell script that puts it in the environment. It may
not be a complex shell script; but it is a shell script.
A main part of maintaining a software project is managing
configuration changes. The best way of managing configuration changes
is store your configuration in a VCS in order to track changes.
So you add your shell script that configures your environment to a VCS¹.
Now your configuration is still "in code", but its not in "your code",
and now it's not even in the same language. About the only good thing
that is achieved is that the configuration is in a separate
repository, but that is orthogonal to sticking your DB credentials in
to the environment - you could do that with any configuration file.
Finally, the environment is a very public place to put things. The
environment is passed to any subprocesses you spawn, and included in
any debug emails. Django goes to some trouble to scrub passwords from
the settings it puts in debug emails; I don't see anything in the
Django docs about it scrubbing the environment..
Cheers
Tom
¹ Now, some wise-ass is going to come along and say "Oh no, thats not
what you do, you put the environment settings in to puppet/chef/etc".
You don't store your puppet configuration in VCS? *How* are you
managing change exactly?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
django-users+unsubscribe@googlegroups.com.
To post to this group, send email to
django-users@googlegroups.com.
Visit this group at
http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAFHbX1L273fSEu1W84LXxmm0%2B_9WkQ0wjtWqrh4c9S0M-ufo-Q%40mail.gmail.com.
For more options, visit
https://groups.google.com/d/optout.