Archive for the ‘django’ Category

Ajax long polling with Django

October 7, 2010 Leave a comment

This post is to document the steps I took to make the ajax long polling example on work on Centos 5.5 (32bit):
0) Prepare
a. add additional repositories
rpm --import
rpm -K rpmforge-release-0.5.1-1.el5.rf.*.rpm
# if the above step returns "rpmforge-release-0.5.1-1.el5.rf.i386.rpm: (sha1) dsa sha1 md5 gpg OK", continue
rpm -i rpmforge-release-0.5.1-1.el5.rf.*.rpm

[ credit: ]

b. install python-setuptools
yum install python-setuptools

1) Install greenlet
cd /tmp
tar xzf greenlet-0.3.1.tar.gz
cd greenlet-0.3.1
python install

2) Install Cython
tar xzf Cython-0.13.tar.gz
cd Cython-0.13
python install

3) Install mercurial (which provides the tool hg to download gevent in the next step)
yum install mercurial

4) Install gevent and the webchat example
cd /tmp
hg clone
cd gevent
python install

5) Install Django
cd /tmp
tar xzvf Django-1.2.3.tar.gz
cd Django-1.2.3
sudo python install

6) Install python-uuid, python-simplejson and python-sqlite2
easy_insall uuid
yum install python-simplejson
yum install python-sqlite2

[ the first command in this step can be substituted with yum install python-uuid I believe, though I didn’t try it because easy_install uuid works ]

7) Run the webchat example
cd /tmp/gevent/examples/webchat

Categories: django, howto Tags: ,