Just want to throw my 3c in here...

Firstly, for reference, I wrote django-classy-settings to help with various settings related problems, one of which being env-based setting.

https://github.com/funkybob/django-classy-settings

As my env decorators are written to be class properties, they don't quite fit this discussion... however, things to consider:

1. All env vars can have a fallback value (the method in my case)
2. You can mark an env var as not having a fallback value, and it will raise an error at start up if not set.
3. Non-trivial value types are not easy.

The URL series of settings helpers deal with many of these cases fairly well, as they allow us to specify a backend (protocol), username, password, host, port, and positional and keyword arguments.

Registering more protocols is actually quite easy, all told.

However, it becomes tricky when we allow multiples, such as database and cache backends. Do we settle on, for instance, a pattern of "DJANGO_DATABASE_{name}="? Or some other scheme?

Email settings are certainly another big one, IME... as well as AWS keys...

--
C

--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/570BE142.3000209%40tinbrain.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to