I looked at the libs that do what we want:
django-configurations - it looks like they use environment variables /
either via loading them from the environ or a key/value pair file. Having
classes inside the settings.py might be weird to people.. at the least very
different.
confucius - very simplistic, only supports environ and is classed based,
similar to django-configurations.
django-environ - supports env file and environ, non-class based.
dynaconf - supports all kinds of loading options (toml, json, ini, environ,
.env +) non-class based.
In my opinion, django-environ and dynaconf would be the easiest to sell to
the community, it would require the least changes/paradigm shifts from how
everyone is already using django.
Personally, i would really like to see something like this inside my
settings.py:
from django.conf import from_env # using standard os.environ
DEBUG = from_env.bool("DEBUG", default=False)
DATABASES = {
"default": from_env.db("DATABASE_URL") # crash if it cant find it
}
...
for more complex examples:
from django.conf import EnvFileLoader
from_env = EnvFileLoader("path/to/.secret")
...
We can have how ever many loaders we want: toml, json, ini ..
This is both borrowing heavily from dynaconf and django-environ, making the
fewest changes to how people are accustomed to doing things.
.. what do you guys think?
- Buzzi
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/41cea044-ffe1-445d-ab7a-a65f69e6d85ao%40googlegroups.com.