I would like to run a certain python file whenever the OpenShift app starts. I have tried many things, like in the wsgi.py file running execfile("thefilename.py")
which didn't work!
I was hoping to get some help with this! Thanks so much!
Running from a bash script.
#!/bin/bash
export LD_LIBRARY_PATH="/opt/rh/python33/root/usr/lib64"
export PATH="/var/lib/openshift/<your ssh id>/python//virtenv/venv/bin:/var/lib/openshift/<your ssh id>/python//bin:/opt/rh/python33/root/usr/bin:/bin:/usr/bin:/usr/sbin"
source ${VIRTUAL_ENV}/bin/activate
python pathtofile/yourfile.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With