Saturday, November 01st, 2008 | Author: number.0

I’m quite new to Django, Pinax and mod_wsgi, so today i decided to try on Pinax with a Slackware 12.1 development box. Everytime I forget after doing something, so better to note it down here, easier for me to remind it later, official Pinax 0.5 has been out for few days, and it’s a good time to try it to see how it can replace my current home-made PHP CMS. I’m not very used to Django, so another chance to play with it, my experience with Python framework only stop at Skunkweb & Quixote.

Okay, now is how i managed everything to work with some helps from James Tauber on #pinax irc

+ Before downloading Pinax 0.5, you need to setup Apache2, Django & mod_wsgi on Slackware 12.1, configure and load mod_wsgi in apache. Googling will be your friend :)

+ Download Pinax from http://pinaxproject.com/download

+ Unzipped to /srv/pinax

+ Firstly initialize the database (sqlite3):

#/srv/pinax/projects/complete_project/manage.py syncdb

This will create dev.db in complete_project, it will create an user during installation for you to login

Okay, now it’s time to adjust something

+ To run in mod_wsgi, the database file should be in absolute path, so edit /srv/pinax/projects/complete_project/settings.py:

DATABASE_NAME = ‘/srv/pinax/projects/complete_project/dev.db’

+ Add a symlinks to your django admin media folder (mine is at: /usr/lib/python2.5/site-packages/django/contrib/admin/media/)

#ln -s /usr/lib/python2.5/site-packages/django/contrib/admin/media /srv/pinax/projects/complete_project/admin_media

+ Made everything owned by apache user/group

#chown -R apache:apache /srv/pinax

+ The wsgi for deployment stays in /srv/pinax/projects/complete_project/deploy/complete_project.wsgi, we need to specify this in the apache virtual host, here is mine /etc/httpd/extra/httpd-vhosts:

<VirtualHost *:80>
ServerAdmin admin@pinax.dev.com
ServerName pinax.dev.com
DocumentRoot “/srv/pinax”
WSGIScriptAlias / /srv/pinax/projects/complete_project/deploy/complete_project.wsgi
Alias /site_media /srv/pinax/projects/complete_project/site_media
Alias /media/ /srv/pinax/projects/complete_project/admin_media/
WSGIProcessGroup pinax
WSGIDaemonProcess pinax user=apache group=apache threads=25

<Directory “/srv/pinax”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog “/var/log/httpd/pinax.dev.com-error-log”
</VirtualHost>

(Note: You need to put an entry in /etc/hosts for pinax.dev.com point to 127.0.0.1)

+ Restart the apache server #/etc/rc.d/rc.httpd restart

+ Browse http://pinax.dev.com to see if it works. If you encounter the PYTHON_EGG_CACHE problem then create folder .python-eggs inside /var/www and made it owned by apache user/group

Hope that will work for u too. Still not working, head on #pinax irc, you might get the answer

Share/Save/Bookmark

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply