Environment Properties Not Avaialble In Django ElasticBeanstalk

Viewed 99

I have set a few variable properties by going to the environment -> configuration -> Modify Software -> Environment properties.

When I SSH into the instance, activate the virtual environment and run python and check for the variable, it returns nothing.

This is what I type before I enter the python shell:

source /opt/python/run/venv/bin/activate
cd /opt/python/current/app/
python

>>> import os
>>> os.environ.get('VARIABLE')
>>>
1 Answers

Since you are using Amazon Linux 1, the EB env variables are stored in /opt/python/current/env . Thus, to source them after you ssh into the instance you can do the following:

source /opt/python/current/env
Related