June本地环境搭建
python-china.org论坛使用的June程序就是这货了,使用了Python Flask + SQLite + Node.js 的轻论坛,以后就打算拿这个学习了,如果可能,进行二次开发。
Github:https://github.com/pythoncn/june
花了一下午的时间在本地搭建起来,这几天的学习算是对Python Web的有个大概的了解了。不过什么都不懂然后强行搭建环境真的是累的吐血...
本篇就不啰嗦的记录这几天的琐事种种了。把方法记录下,以便后用。
[shell]
# - Add EPEL
wegt http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum makecache
# - Install bzip2(Node.js used)
yum install bzip2-devel
# - Install python2.7 instand of 2.6
wget --no-check-certificate https://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
tar -jxvf Python-2.7.5.tar.bz2
cd Python-2.7.5
# - zlib
# - modify Modules/Setup.dist
# remove the top '#' - #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
vim Modules/Setup.dist
./configure
make all
make install
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python
/* now use:python -V can show the Version is 2.7.5 */
vim /usr/bin/yum # Modify #!/usr/bin/python To #!/usr/bin/python2.6.6
# - Install Node.js
yum install libtool automake autoconf gcc-c++ openssl-devel
wget http://nodejs.org/dist/v0.10.30/node-v0.10.30.tar.gz
tar zxvf node-v0.10.30.tar.gz
cd node-v0.10.30
./configure
make
make install
/* now use:node -v can show the Version is v0.10.30 */
# - Install setuptools
wget --no-check-certificate https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
chmod +x setuptools-0.6c11-py2.7.egg
sh setuptools-0.6c11-py2.7.egg
# - Install pip
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz
tar zxvf pip-1.5.6.tar.gz
cd pip-1.5.6
/* now use:pip -v can show the Version is pip 1.5.6 from /usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg (python 2.7) */
# - Install virtualenv
pip install virtualenv
# - Some
yum install git
npm install -g stylus component uglify-js nib
# - SQLite
yum install sqlite sqlite-devel # if unwork, try sqlite2 sqlite2-devel
pip install pysqlite
# - Get june and run
git clone https://github.com/pythoncn/june.git
cd june
virtualenv --distribute venv
source venv/bin/activate
(venv)$ pip install -r requirements.txt
(venv)$ make static
(venv)$ python manager.py createdb
(venv)$ python manager.py runserver
[/shell]
就是这样,首先先在github的官方页看大概的教程。然后如果使用Centos 6.5的话直接复制命令就能成功的。
Ps. 请无视我的/* */注释......不写的话不舒服的......嗯...过阶段我就会去接受治疗的...