Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Monday, April 19, 2010

Installing OSQA

While installing OSQA, an opensource clone of StackExchange (Stackoverflow) written in Python (Django), I encountered a few gotchas

Installation instructions:
http://wiki.osqa.net/display/docs/OSQA+Installation+and+Upgrade+Guides
http://wiki.osqa.net/display/docs/Setting+Up+OSQA+for+Apache
http://wiki.osqa.net/display/docs/Ubuntu+9+with+MySQL

Gotchas:

1. Install mod-wsgi for Apache2

sudo apt-get install libapache2-mod-wsgi
2. Commented code in Apache.conf

The following commented code seems to screw up restarting of apache

WSGISocketPrefix /path/to/socket/sock #must be readable and writable by apache
WSGIPythonHome /usr/local #must be readable by apache
WSGIPythonEggs /var/python/eggs #must be readable and writable by apache
Just get rid of them.

3. WSGI script in documentation

As documented in http://wiki.osqa.net/display/docs/Setting+Up+OSQA+for+Apache

os.environ['DJANGO_SETTINGS_MODULE'|'DJANGO_SETTINGS_MODULE'] = 'osqa.settings'
That pipe screws things up. I'm not exactly familar with python so maybe it's deprecated in Python 2.6? Anyways just get rid of it.

os.environ['DJANGO_SETTINGS_MODULE'] = 'osqa.settings'
4. Table migration

Apparently if you followed the recommendation to use South for migration you'll soon find that it FAILS. Yikes! Search their Q&A (meta) provides an answer.

http://meta.osqa.net/question/111/installation-programmingerror-forum_keyvalue-doesnt-exist

Just do

./manage.py syncdb --all
./manage.py migrate --fake
Hmm...