Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5120066
  • 博文数量: 921
  • 博客积分: 16037
  • 博客等级: 上将
  • 技术积分: 8469
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-05 02:08
文章分类

全部博文(921)

文章存档

2020年(1)

2019年(3)

2018年(3)

2017年(6)

2016年(47)

2015年(72)

2014年(25)

2013年(72)

2012年(125)

2011年(182)

2010年(42)

2009年(14)

2008年(85)

2007年(89)

2006年(155)

分类: Python/Ruby

2011-11-11 15:37:43

Django是一个开放源代码的Web应用框架,由Python写成,它最初是被开发来用于管理劳伦斯出版集团旗下的一些以新闻内容为主的网站的。 python+django也是web开发者最受欢迎的框架.今天记录下整个搭建开发环境的过程.(说明下环境的系统为 centos 5.2)
   一:更新yum仓库(目前这个yum源是最快的)

[root@filerserver python]#cd /etc/yum.repos.d
[root@filerserver python]#mv CentOS-Base.repo CentOS-Base.repo.save
[root@filerserver python]#wget
[root@filerserver python]#mv CentOS-Base.repo.5 CentOS-Base.repo

二:安装部分的开发包和更新

[root@filerserver python]#yum check-update
[root@filerserver python]#yum update
[root@filerserver python]#yum install ntp iptraf sysstat screen subversion wget bzip2 nfs-utils vim-common
[root@filerserver python]#yum install make gcc gcc-c++ libjpeg-devel libpng-devel zlib-devel tcl-devel freetype-devel libevent-devel openssl-devel db4-devel curl-devel pcre-devel ncurses-devel readline-devel sqlite-devel

三:安装Python

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xjvf Python-2.5.4.tar.bz2
[root@filerserver python]#cd Python-2.5.4/
[root@filerserver python]#./configure --enable-unicode=ucs4
[root@filerserver python]#make
[root@filerserver python]#make install

四:安装MySQL客户端

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar zxvf mysql-5.0.45.tar.gz
[root@filerserver python]#cd mysql-5.0.45
[root@filerserver python]#CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \
                                       -fno-exceptions -fno-rtti" ./configure \
                                       --prefix=/usr/local/mysql --enable-assembler \
                                       --with-charset=utf8 \
                                       --with-extra-charsets=gbk,gb2312,latin1 \
                                       --without-debug \
                                      --with-client-ldflags=-all-static \
                                       --enable-thread-safe-client \
                                       --without-server
[root@filerserver python]#make
[root@filerserver python]#make install
[root@filerserver python]#echo "PATH=/usr/local/mysql/bin:\$PATH" >> /etc/profile
[root@filerserver python]#echo "export PATH" >> /etc/profile
[root@filerserver python]#echo "/usr/local/mysql/lib/mysql" > /etc/ld.so.conf.d/mysql.conf
[root@filerserver python]#ldconfig

五:安装memcached

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xzvf memcached-1.2.6.tar.gz
[root@filerserver python]#cd memcached-1.2.6/
[root@filerserver python]#./configure --prefix=/usr/local/memcached --enable-threads
[root@filerserver python]#make
[root@filerserver python]#make install

六:安装python setuptools

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xzvf setuptools-0.6c9.tar.gz
[root@filerserver python]#cd setuptools-0.6c9
[root@filerserver python]#python setup.py install

七:安装django

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#svn co django-trunk #直接重django的SVN拿最新稳定安装包
[root@filerserver python]#cd django-trunk
[root@filerserver python]#python setup.py install

八:安装sqlalchemy

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#svn co
[root@filerserver python]#cd sqlalchemy-0.4
[root@filerserver python]#python setup.py install


九:安装MySQLdb

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xzvf MySQL-python-1.2.2.tar.gz
[root@filerserver python]#cd MySQL-python-1.2.2
[root@filerserver python]#python setup.py install

十:安装Twisted

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xjvf Twisted-8.2.0.tar.bz2
[root@filerserver python]#cd Twisted-8.2.0/
[root@filerserver python]#python setup.py install

十一:安装python-memcached

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xzvf python-memcached-1.44.tar.gz
[root@filerserver python]#cd python-memcached-1.44
[root@filerserver python]#python setup.py install

十二:安装PIL

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xzvf Imaging-1.1.6.tar.gz
[root@filerserver python]#cd Imaging-1.1.6
[root@filerserver python]#python setup.py install

十三:安装flup

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xzvf flup-1.0.1.tar.gz
[root@filerserver python]#cd flup-1.0.1
[root@filerserver python]#python setup.py install

十四:安装simplejson

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xzvf simplejson-2.0.9.tar.gz
[root@filerserver python]#cd simplejson-2.0.9
[root@filerserver python]#python setup.py install

十五:安装nginx

[root@filerserver python]#cd /usr/local/src
[root@filerserver python]#wget
[root@filerserver python]#tar xzvf nginx-0.7.51.tar.gz
[root@filerserver python]#cd nginx-0.7.51
[root@filerserver python]#./configure --prefix=/usr/local/nginx \
                                       --with-md5=/usr/lib \
                                       --with-sha1=/usr/lib \
                                       --with-http_ssl_module \
                                       --with-http_stub_status_module \
                                       --without-mail_pop3_module \
                                       --without-mail_imap_module \
                                       --without-mail_smtp_module \
                                        --with-http_realip_module
[root@filerserver python]#make
[root@filerserver python]#make install


      到此这个环境搭建完成

本文来自:http://hi.baidu.com/wxyworld/blog/item/b9878224183d95398644f929.html

阅读(1034) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~