How to run manage.py from AWS EB (Elastic Beanstalk) Linux instance?
If I run it from \'/opt/python/current/app\', it shows the below exception.
This answer assumes you have installed EB CLI. Follow these steps:
eb ssh
. /opt/python/current/env
If you wish you can see the environment variables using printenv.
source /opt/python/run/venv/bin/activate
XX)cd /opt/python/bundle/XX/app/
python manage.py
Asumming that your environment name is my-env, your latest deployment number is 13, and you want to run the shell command:
eb ssh my-env # 1
. /opt/python/current/env # 2
source /opt/python/run/venv/bin/activate # 3
cd /opt/python/bundle/13/app/ # 4
python manage.py shell # 5