You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When DATABASE_URL == "", django-environ will return an empty dict if the default argument has been passed.
If the variable doesn't exist, the default argument is correctly used.
When DATABASE_URL is set to empty string: {'default': {}}
I think it would be better if an empty string for DATABASE_URL value would lead to the same behavior as when the variable isn't set. docker-compose for example defaults to empty strings when a variable isn't set.
The text was updated successfully, but these errors were encountered:
@jeverling Although I guess a quick checking on the var value to coerce empty to None would safely do, I'd like to point you to relevant related issues which are similar to yours: #192, #209 (almost identical, but for int), #227, #451.
Your issue it's a very good example of the problem discussed there in more detail. I'd suggest you to add your case there to provide another example, since it's likely to get more attention (and also close this issue as duplicate).
When
DATABASE_URL == ""
, django-environ will return an empty dict if thedefault
argument has been passed.If the variable doesn't exist, the
default
argument is correctly used.E.g. consider this:
When
DATABASE_URL
is not set:When
DATABASE_URL
is set to empty string:{'default': {}}
I think it would be better if an empty string for
DATABASE_URL
value would lead to the same behavior as when the variable isn't set.docker-compose for example defaults to empty strings when a variable isn't set.
The text was updated successfully, but these errors were encountered: