Closed mahdizojaji closed 1 year ago
You can pass default=None
, and it will be cast to []
as mentioned in #149.
In [1]: from decouple import config, Csv
In [2]: config(
...: "CORS_ALLOWED_ORIGINS",
...: cast=Csv(delimiter=","),
...: default=None,
...: )
Out[2]: []
I want to have an optional environment. When it's filled: separate data with a comma. and when the variable is not found, it should be an empty list.
I thought this code should work:
but I got this error: