On 26.09.2013, at 01:45, Russell Keith-Magee <russ...@keith-magee.com> wrote:
> > On Thu, Sep 26, 2013 at 4:21 AM, VernonCole <vernondc...@gmail.com> wrote: > I find myself using up lots of time and keystrokes explaining about the > benefits and methods of a structured settings module in django. > For example: Using-a-Structured-Settings-environment > > It occurs to me that life would be easier if django shipped already set up > for structured settings, rather than having to retro-fit it. The pull > request I sent to formhub could be a starting point for the conversion. > (formhub/pull/1240) The changes to core are simple enough that I could do it. > > Your opinions please, Would such a change be good for django 1.7? > > Based on conversations that I had at the sprints at DjangoCon US, I'd say > probably not -- because the winds are blowing in another direction. > > The primary reason to need structured settings like this is because your > development environment is different to your deployment environment (e.g., > different passwords, paths and so on). > > However, the emerging best practice for this sort of thing is best described > by the "12 factor" approach: > > http://12factor.net > > Factors 10 and 3 are the most relevant to this discussion -- 10 says that > development and production should be the same; 3 says that anything that > needs to vary should be set as an environment variable, and consumed from > there. > > So - I'd expect to see Django moving towards better support for a 12 factor > environment, rather than embedding separate settings files as a deployment > practice. Speaking of which (apologies if I hijack the thread), django-configurations now has Value classes that can inspect the process environment to set the values of settings: http://django-configurations.readthedocs.org/en/latest/values/ Since I've really enjoyed using the URL-based approach for some settings following the 12 factor methodology, I've also added some special Value subclasses to setup DATABASES, CACHES and the EMAIL* settings (each using the respective 3rd party app to do the actual heavy lifting, like the also mentioned dj-database-url). Just a side note.. Best, Jannis
signature.asc
Description: Message signed with OpenPGP using GPGMail