On 25 oct, 14:28, Thomas Guettler <h...@tbz-pariv.de> wrote:

> I would like to see a common variable in django's settings:
>  STAGE=...
>  with one of this choices: DEV, INTEGRATION, QUAL, PROD
>
> It would be nice, if the django core could agree on a variable name and its 
> content.
> Several deploy apps could use this common variable.
>
> In our company we have a common variable. PROD is zero:
>
> if STAGE:
>     # some dev system...

Me too. We use CONFIG_DEV='dev', CONFIG_PROD='prod',
CONFIG_BETA='beta' and then assign one of these three to
settings.CONFIG. Our deployment app used to replace CONFIG=CONFIG_DEV
by CONFIG=CONFIG_PROD

It would be good to agree on a naming convension for this.

However,... on newer applications, our deployment app does automatic
generation the parts from the settings (like IP addresses) which are
in production different from the development settings.

The question is, should a git/gh/... repository contain any production
specific settings? (Assuming one is using a vcs checkout.) Deployment
scripts are perfectly capable of replacing the config with production
settings right after the checkout.

Further, I think that applications should be agnostic about in what
environment they run. They should never behave different locally, in
stage or in production. You have settings which contains IP addresses,
DEBUG=True/False, etc... but I think they don't have to know whether
they run in production or not. The only reason for such a variable to
exists, may be to decide between several other settings to include.
Correct me if you think differently.

Cheers,
Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to