In my __init__.py
file I am trying to set:
import os
app.config['SECRET_KEY'] = os.environ['MY_KEY']
but am getting the error:
raise KeyError(key)
KeyError: 'MY_KEY'
When I run printenv
, the variable MY_KEY
is present.
Also in IDLE
I tried running:
import os
print os.environ['MY_KEY']
and I get the correct output.
I set MY_KEY
in /etc/profile
using:
export MY_KEY="1234example_secret_key"
I did restart
my computer after making the change to the profile
file.
Would anyone know what the issue may be?
Thanks for your help.