building web pages with python installation

Installing the Components

PySQLite

Download the source from its homepage.

tar xzvf pysqlite-2.3.2.tar.gz
cd pytsqlite-2.3.2
sudo python setup.py install

SQLite Shell

The SQLite shell is a generic shell that you can use to directly issue SQL commands. You can find it at the SQLite homepage.

tar xzvf sqlite-3.3.6.tar.gz
cd sqlite-3.3.6
./configure
sudo make && make install

SQLAlchemy

SQLAlchemy can be installed using easy_install. Directions for setting up easy_install can be found here.

sudo easy_install SQLAlchemy

Jinja

Jinja can also be installed with easy_install

sudo easy_install Jinja

FormEncode

As can FormEncode

sudo easy_install FormEncode

PythonPaste

As a prerequisite for Colubrid, you need PythonPaste installed.

sudo easy_install PythonPaste

Colubrid

You'll need the SVN version of Colubrid. It's pretty stable, so no worries about bugs. You can get the full package (including examples) like so:

svn co http://trac.pocoo.org/repos/colubrid/trunk .

All you really need is the colubrid directory in the site-packages directory of your Python installation, though. So this works, too:

cd /path/to/python/site-packages
svn co http://trac.pocoo.org/repos/colubrid/trunk/colubrid colubrid

update: This has been fixed in the SVN repo. There's currently a bug with Colubrid's fix_slash() function. You can fix it by editing the application.py file. Replace all occurances of:

fix_slash(self._environ, True)

with

fix_slash(self.request.environ, True)

Flup

I'm not going to use Apache when developing the application. Instead, I'll be using Colubrid's build in HTTP server. This way, all of the error messages are easily sent to STDOUT. However, when the application is ready to deploy with Apache, Flup will be needed. it's also another SVN package.

svn co http://svn.saddi.com/flup/trunk flup
cd flup
sudo python setup.py install

FastCGI

FastCGI is also needed for the application deployment. Here are instructions I used from Django's wiki to install it on OS X:

curl -O http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
tar xvfz mod_fastcgi-2.4.2.tar.gz 
cd mod_fastcgi-2.4.2
/usr/sbin/apxs -o mod_fastcgi.so -c *.c
sudo /usr/sbin/apxs -i -a -n fastcgi mod_fastcgi.so
cd ..; rm -rf mod_fastcgi-2.4.2*