Features:
- Add `env` singleton ([194]).
Thanks [AndBondStyle](https://github.com/AndBondStyle) for the suggestion.
python
from environs import env
Changes:
- `default` values are expected to be their in their deserialized form.
_Backwards-incompatible_: Passing serialized values to `default`
is no longer supported.
python
from datetime import date, timedelta
import environs
DO
enable_login = env.bool("ENABLE_LOGIN", True)
ttl = env.timedelta("TTL", default=timedelta(seconds=600))
release_date = env.date("RELEASE", date(2025, 1, 7))
numbers = env.list("FOO", [1.0, 2.0, 3.0], subcast=float)
DON'T
enable_login = env.bool("ENABLE_LOGIN", "true")
ttl = env.timedelta("TTL", default=600)
release_date = env.date("RELEASE", "2025-01-07")
numbers = env.list("NUMBERS", "1,2,42", subcast=float)
The exceptions to this rule are the Django-related functions, which
accept string defaults.
python
DATABASE_URL = env.dj_db_url("DATABASE_URL", default="postgresql://localhost:5432/mydb")
This fixes [297](https://github.com/sloria/environs/issues/297)
and [270](https://github.com/sloria/environs/issues/270).