dreamhost上编译python并安装django

python 2.5安装步骤:

wget http://www.python.org/ftp/python/2.5.2/python-2.5.2.tgz
tar -zxvf python-2.5.2.tgz
cd python-2.5.2
./configure –prefix=$home/lib –enable-unicode=ucs4
make
make install

python 2.5已经安装好了。把python 2.5设置为默认版本:

mkdir $home/bin
mkdir $home/bin/python
mkdir $home/bin/python/bin
ln -s $home/lib/bin/python $home/bin/python/bin/python

然后,在$home.bash_profile里加入一条:

export path=$home/bin/python/bin:$home/lib/bin:$path

重新载入配置文件:

source ~/.bash_profile

检验一下是否成功,输入python,显示:

python 2.5.2 (r252:60911, apr 4 2008, 22:51:28)
[gcc 3.3.5 (debian 1:3.3.5-13)] on linux2
type “help”, “copyright”, “credits” or “license” for more information.

mysql-python安装

wget http://nchc.dl.sourceforge.net/s … python-1.2.2.tar.gz
tar -zxvf mysql-python-1.2.2.tar.gz
cd mysql-python-1.2.2
python setup.py build
python setup.py install

安装django

sudo wget -c http://media.djangoproject.com/releases/0.96/django-0.96.tar.gz
tar xzvf django-0.96.tar.gz
cd django-0.96
sudo python setup.py install

测试一下django是否安装成功

cd ~
django-admin.py startproject djangosite
cd djangosite
sudo chmod +x manage.py
python manage.py runserver

显示

validating models…
0 errors found.

starting server on port 8000 with settings module ‘newtest.settings’.
go to http://127.0.0.1:8000/ for django.
quit the server with control-c (unix) or ctrl-break (windows).

安装flup

sudo wget -c http://www.saddi.com/software/flup/dist/flup-0.5.tar.gz
tar xzvf flup-0.5.tar.gz
cd flup-0.5
sudo python setup.py install

Posted in 未分类

发表评论