[Fixed]-Git Push failing on Openshift?

1👍

The symptoms you see are not strictly the same as the issue it is claimed this duplicates, but the need to set STATIC_ROOT properly as a remedy is.

The error you get suggests you have hard coded the path for STATIC_ROOT to be an actual path on your local MacOS X system. You can’t do that, you need to calculate it dynamically.

In the case of OpenShift, you should set STATIC_ROOT as:

STATIC_ROOT = os.path.join(os.environ['OPENSHIFT_REPO_DIR'], 'wsgi', 'static')

When collectstatic is run, it should then put static files under the directory wsgi/static within OpenShift. That directory is special and when it exists OpenShift will configure automatically the Apache/mod_wsgi instance to serve up static files from that location at the URL /static. So make sure STATIC_URL is also set to /static.

Leave a comment