I have a Django project that works in a virtual environment. There is also a line export ENV=stagingin the .bashrcfile. And in the settings, I'm trying to read this with os.getenv('ENV'), but it returns None.
settings_staging.py
...
ENV = os.getenv('ENV')
...
.bashrc
...
export ENV=staging
...
Error
[dev.gipi] out: File "/home/ubuntu/projects/deeyoon/settings/settings.py", line 61, in <module>
[dev.gipi] out: raise Exception('Environment variable ENV is requried!')
[dev.gipi] out: Exception: Environment variable ENV is requried!
What can cause the problem or what is going wrong?
Sultan.
source
share