Вопрос

I have a flask application on AWS. I need to access a python script inside the App directory at runtime (to run a daily cron job). I've SSH access to the EC2 server, but I can't locate the directory in which AWS has uploaded my code. Any idea where AWS puts the code?

Это было полезно?

Решение

Elastic beanstalk organizes python code under: /opt/python/

Specifically your current app is available under /opt/python/current/app (/opt/python/current is a link to /opt/python/bundle/${bundle_version}/)

Remember that Beanstalk makes use of virtualenv and its location is: /opt/python/run/venv

If you want to use a python shell with all the environment variable you are expecting you have to:

source /opt/python/run/venv/bin/activate

then:

source /opt/python/current/env

(with the first command you activate the virtual environment with the seconds you load up all the environment variables you did define via eb settings)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top