The Golden Spot

I hope this helps someone who is learning about Linux and web application programming with Python, Django, and Javascript.

Friday, November 07, 2008

Python 2.6 and latest Django with Postgresql on Debian Etch.

I built and installed Python 2.6 from source but I used Debian Etch build of Postgresql from Synaptic. I needed to use Postgres instead of MySQL because the Python bindings to MySQLDB do not work with Python 2.6 as of today ( so I hear ). I decided to build the latest version of psycopg2, which is the Python binding for Postgres because the Synaptic version of psycopg2 might be configured for the Debian default version of Python 2.4.4. First, I had to get libpq-dev and libpq4 from Synaptic. Then I got the source of psycopg2-2.0.8. Next, build/install:

$ python2.6 ./ build
$ sudo python2.6 ./ install

( python2.6 is named as such because I made altinstall when running make for Python 2.6 )

I was able to test that this is working so far

$ python2.6
Python 2.6 (r26:66714, Nov 3 2008, 01:27:29)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 1, 0, 'alpha', 0)
>>> import psycopg2
>>> psycopg2.apilevel

It works so far; now I simply have to get Django and Apache working.

Labels: , , ,


Post a Comment

<< Home