Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Commands to configure LFS on WebFaction mod_wsgi/Django
cd ~/webapps/app_name/
rm -rf lib/python2.7/{D,d}jango* myproject*
PYTHONPATH=$PWD/lib/python2.7 easy_install-2.7 -s $PWD/bin -d $PWD/lib/python2.7 zc.buildout
tar zxf django-lfs-installer-0.6.0b5.tar.gz
cd lfs-installer/
./bin/buildout -v # this will take a while to run and produce a lot of output, so be patient
sed -i "s/'ENGINE': 'django.db.backends.'/'ENGINE': 'django.db.backends.postgresql_psycopg2'/g" lfs_project/
sed -i "s/'NAME': ''/'NAME': 'db_name'/g" lfs_project/
sed -i "s/'USER': ''/'USER': 'db_name'/g" lfs_project/
sed -i "s/'PASSWORD': ''/'PASSWORD': 'db_password'/g" lfs_project/
sed -i "s/ADMIN_MEDIA_PREFIX/#ADMIN_MEDIA_PREFIX/g" lfs_project/
./bin/django syncdb
./bin/django lfs_init
./bin/django collectstatic
cat > ../lfs_project.wsgi <<EOF
import os
import sys
$( grep -B 1 -A 1 lfs-installer bin/django )
from django.core.handlers.wsgi import WSGIHandler
os.environ['DJANGO_SETTINGS_MODULE'] = 'lfs_project.settings'
application = WSGIHandler()
sed -i 's/myproject/lfs_project/g' ../apache2/conf/httpd.conf

This comment has been minimized.

Copy link
Owner Author

defulmere commented Nov 29, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.