Created
February 1, 2015 18:47
-
-
Save stavinsky/d558c6fad45847e0687f to your computer and use it in GitHub Desktop.
django openshift static files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd $OPENSHIFT_REPO_DIR/app | |
python manage.py migrate | |
mkdir -p $OPENSHIFT_DATA_DIR/static | |
ln -s $OPENSHIFT_DATA_DIR/static $OPENSHIFT_REPO_DIR/wsgi/static | |
python manage.py collectstatic --noinput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if not os.environ.get('OPENSHIFT_REPO_DIR'): | |
os.environ['OPENSHIFT_DATA_DIR'] = '/Users/stavinsky/temp/db/' | |
STATIC_URL = '/static/' | |
STATIC_ROOT = os.environ['OPENSHIFT_DATA_DIR'] + 'static/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
if os.environ.get('OPENSHIFT_PYTHON_DIR'): | |
virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/' | |
virtualenv = os.path.join(virtenv, 'bin/activate_this.py') | |
try: | |
execfile(virtualenv, dict(__file__=virtualenv)) | |
except IOError: | |
pass | |
# | |
# IMPORTANT: Put any additional includes below this line. If placed above this | |
# line, it's possible required libraries won't be in your searchable path | |
# | |
import sys | |
if not os.environ.get('OPENSHIFT_REPO_DIR'): | |
os.environ['OPENSHIFT_REPO_DIR'] = '/Users/stavinsky/PycharmProjects/financetalk/' | |
sys.path.append(os.environ.get('OPENSHIFT_REPO_DIR')+'/app') | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'app.settings' | |
from django.core.wsgi import get_wsgi_application | |
application = get_wsgi_application() | |
if __name__ == '__main__': | |
from wsgiref.simple_server import make_server | |
httpd = make_server('localhost', 8051, application) | |
# Wait for a single request, serve it and quit. | |
httpd.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment