Chinaunix首页 | 论坛 | 博客
  • 博客访问: 74488
  • 博文数量: 24
  • 博客积分: 82
  • 博客等级: 民兵
  • 技术积分: 140
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-19 12:39
文章分类
文章存档

2012年(14)

2011年(10)

分类:

2012-09-29 09:44:26

Django是一个开放源代码的Web应用框架,由Python写成,它最初是被开发来用于管理劳伦斯出版集团旗下的一些以新闻内容为主的网站的。python+django也是web开发者最受欢迎的框架.今天记录下整个搭建开发环境的过程.(说明下环境的系统为 centos 5.2)
   一:更新yum仓库(目前这个yum源是最快的)
  1. 一:更新yum仓库(目前这个yum源是最快的)
  2. [root@filerserver python]#cd /etc/yum.repos.d
  3. [root@filerserver python]#mv CentOS-Base.repo CentOS-Base.repo.save
  4. [root@filerserver python]#wget
  5. [root@filerserver python]#mv CentOS-Base.repo.5 CentOS-Base.repo
  6. 二:安装部分的开发包和更新
  7. [root@filerserver python]#yum check-update
  8. [root@filerserver python]#yum update
  9. [root@filerserver python]#yum install ntp iptraf sysstat screen subversion wget bzip2 nfs-utils vim-common
  10. [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
  11. 三:安装Python
  12. [root@filerserver python]#cd /usr/local/src
  13. [root@filerserver python]#wget
  14. [root@filerserver python]#tar xjvf Python-2.5.4.tar.bz2
  15. [root@filerserver python]#cd Python-2.5.4/
  16. [root@filerserver python]#./configure --enable-unicode=ucs4
  17. [root@filerserver python]#make
  18. [root@filerserver python]#make install
  19. 四:安装MySQL客户端
  20. [root@filerserver python]#cd /usr/local/src
  21. [root@filerserver python]#wget
  22. [root@filerserver python]#tar zxvf mysql-5.0.45.tar.gz
  23. [root@filerserver python]#cd mysql-5.0.45
  24. [root@filerserver python]#CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \
  25. -fno-exceptions -fno-rtti" ./configure \
  26. --prefix=/usr/local/mysql --enable-assembler \
  27. --with-charset=utf8 \
  28. --with-extra-charsets=gbk,gb2312,latin1 \
  29. --without-debug \
  30. --with-client-ldflags=-all-static \
  31. --enable-thread-safe-client \
  32. --without-server
  33. [root@filerserver python]#make
  34. [root@filerserver python]#make install
  35. [root@filerserver python]#echo "PATH=/usr/local/mysql/bin:\$PATH" >> /etc/profile
  36. [root@filerserver python]#echo "export PATH" >> /etc/profile
  37. [root@filerserver python]#echo "/usr/local/mysql/lib/mysql" > /etc/ld.so.conf.d/mysql.conf
  38. [root@filerserver python]#ldconfig
  39. 五:安装memcached
  40. [root@filerserver python]#cd /usr/local/src
  41. [root@filerserver python]#wget
  42. [root@filerserver python]#tar xzvf memcached-1.2.6.tar.gz
  43. [root@filerserver python]#cd memcached-1.2.6/
  44. [root@filerserver python]#./configure --prefix=/usr/local/memcached --enable-threads
  45. [root@filerserver python]#make
  46. [root@filerserver python]#make install
  47. 六:安装python setuptools
  48. [root@filerserver python]#cd /usr/local/src
  49. [root@filerserver python]#wget
  50. [root@filerserver python]#tar xzvf setuptools-0.6c9.tar.gz
  51. [root@filerserver python]#cd setuptools-0.6c9
  52. [root@filerserver python]#python setup.py install
  53. 七:安装django
  54. [root@filerserver python]#cd /usr/local/src
  55. [root@filerserver python]#svn co django-trunk #直接重django的SVN拿最新稳定安装包
  56. [root@filerserver python]#cd django-trunk
  57. [root@filerserver python]#python setup.py install
  58. 八:安装sqlalchemy
  59. [root@filerserver python]#cd /usr/local/src
  60. [root@filerserver python]#svn co
  61. [root@filerserver python]#cd sqlalchemy-0.4
  62. [root@filerserver python]#python setup.py install
  63. 九:安装MySQLdb
  64. [root@filerserver python]#cd /usr/local/src
  65. [root@filerserver python]#wget
  66. [root@filerserver python]#tar xzvf MySQL-python-1.2.2.tar.gz
  67. [root@filerserver python]#cd MySQL-python-1.2.2
  68. [root@filerserver python]#python setup.py install
  69. 十:安装Twisted
  70. [root@filerserver python]#cd /usr/local/src
  71. [root@filerserver python]#wget
  72. [root@filerserver python]#tar xjvf Twisted-8.2.0.tar.bz2
  73. [root@filerserver python]#cd Twisted-8.2.0/
  74. [root@filerserver python]#python setup.py install
  75. 十一:安装python-memcached
  76. [root@filerserver python]#cd /usr/local/src
  77. [root@filerserver python]#wget
  78. [root@filerserver python]#tar xzvf python-memcached-1.44.tar.gz
  79. [root@filerserver python]#cd python-memcached-1.44
  80. [root@filerserver python]#python setup.py install
  81. 十二:安装PIL
  82. [root@filerserver python]#cd /usr/local/src
  83. [root@filerserver python]#wget
  84. [root@filerserver python]#tar xzvf Imaging-1.1.6.tar.gz
  85. [root@filerserver python]#cd Imaging-1.1.6
  86. [root@filerserver python]#python setup.py install
  87. 十三:安装flup
  88. [root@filerserver python]#cd /usr/local/src
  89. [root@filerserver python]#wget
  90. [root@filerserver python]#tar xzvf flup-1.0.1.tar.gz
  91. [root@filerserver python]#cd flup-1.0.1
  92. [root@filerserver python]#python setup.py install
  93. 十四:安装simplejson
  94. [root@filerserver python]#cd /usr/local/src
  95. [root@filerserver python]#wget
  96. [root@filerserver python]#tar xzvf simplejson-2.0.9.tar.gz
  97. [root@filerserver python]#cd simplejson-2.0.9
  98. [root@filerserver python]#python setup.py install
  99. 十五:安装nginx
  100. [root@filerserver python]#cd /usr/local/src
  101. [root@filerserver python]#wget
  102. [root@filerserver python]#tar xzvf nginx-0.7.51.tar.gz
  103. [root@filerserver python]#cd nginx-0.7.51
  104. [root@filerserver python]#./configure --prefix=/usr/local/nginx \
  105. --with-md5=/usr/lib \
  106. --with-sha1=/usr/lib \
  107. --with-http_ssl_module \
  108. --with-http_stub_status_module \
  109. --without-mail_pop3_module \
  110. --without-mail_imap_module \
  111. --without-mail_smtp_module \
  112. --with-http_realip_module
  113. [root@filerserver python]#make
  114. [root@filerserver python]#make install
   到此这个环境搭建完成
阅读(1123) | 评论(0) | 转发(0) |
0

上一篇:python 可变不可变类型

下一篇:没有了

给主人留下些什么吧!~~