-
-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
In the current implementation every declared value is mapped to a shell variable with a DJANGO_ prefix by default. Prefix value can be overwritten and it must be done per variable declaration.
It would be amazing to be able to declare the default prefix value globally for the whole configuration instead of specifying the same environment prefix for every variable declaration. I think this could be implemented in many ways, ensuring backward compatibility. For example by providing a decorator for the configuration class:
@use_environ_prefix(None)
class Base(Configuration):
# If no environ_prefix is provided, default is used.
# No prefix. Use FOOBAR_KEY environment valiable.
FOOBAR_KEY = values.SecretValue()
# Exiplicit declaration of the environ_prefix for the value always wins.
# Use MYAPP_DEBUG environment variable.
DEBUG = values.BooleanValue(False, environ_prefix="MYAPP")What do you think?
amureki, anneFly, samifahed, umgelurgel, kylegibson-rldatix and 8 more
Metadata
Metadata
Assignees
Labels
No labels