I've got a nested dict format that I wanted to setup in an environment.
It looks like this:
DEPARTMENTS_INFORMATION={
"Pants": {
"name": "Pants Department",
"email": "pants@department.com",
"ext": "x2121"
},
"Shirts": {
"name": "Shirt Department",
"email": "shirts@department.com",
"ext": "x5151"
},
"Socks": {
"name": "Sock Department",
"email": "socks@department.com",
"ext": " "
}
}
I am using django-environ
for this and tried using it like this:
DEPARTMENTS = env.dict("DEPARTMENTS_INFORMATION", default={})
But it's giving me this error:
ValueError: dictionary update sequence element #0 has length 1; 2 is required
I'm not sure how to make the nested dictionary an environment variable - any help appreciated!