django-environ
django-environ copied to clipboard
Detect mismatched default data type
The following does not raise an error:
SECRET_KEY = env.bool('SECRET_KEY', 'some random key')
SECRET_KEY
will be the default value of type str
.
When someone tries to override the default, it will break.
I notice that get_value
(and __call__
) has an argument parse_default=False
- switching this to default to True
may solve the problem.
However, that caused the tests for bytes()
to fail, and one other odd error in test_schema
. I'll play around with these first.