I am trying to deploy a Django app on openshift (python3.3
, django1.7
, Openshift 2.1).
I need to set the OPENSHIFT_PYTHON_WSGI_APPLICATION
to point to an alternative wsgi.py
location.
I have tried using the pre_build
script to set the variable, using the following commands:
export OPENSHIFT_PYTHON_WSGI_APPLICATION="$OPENSHIFT_REPO_DIR"geartest4/wsgi.py
echo "-------> $OPENSHIFT_PYTHON_WSGI_APPLICATION"
I can see during the git push
that the pre_build
script sets the variable correctly. The echo
shows the correct path as expected. However wsgi.py
does not launch and I get:
CLIENT_ERROR: WSGI application was not found
When I immediately ssh
into the gear and check the environment variable I see that OPENSHIFT_PYTHON_WSGI_APPLICATION=""
is not set.
If I set the variable manually from my workstation using rhc set-env OPENSHIFT_PYTHON_WSGI_APPLICATION=/var/lib/openshift/gear_name/bla/bla
then the variable sticks, the wsgi server launches, and the app works fine.
The problem is that I don't want to use rhc set-env
because that means I have to hardwire the gear name in the path. This becomes a problem when I want to do scaling with multiple gears.
Anyone have any ideas on how to set the variable and make stick?