《open-falcon入门教程四》open-falcon上flask

配置Web开发的flask框架
注意:安装有顺序要求
1、yum install python-virtualenv
2、yum -y install python-pip
因为flask_sqlalchemy需要python2.7及以上,而本机centos6.9预装的是python2.6,所以先升级python到2.7.13
3、wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
4、tar zxf Python-2.7.13.tgz
5、cd Python-2.7.13
6、./configure
7、make && make install
默认 Python 2.7.13 会安装在 /usr/local/bin 目录下;系统自带的 Python 是在 /usr/bin目录下
8、mv /usr/bin/python /usr/bin/python.old
9、rm -f /usr/bin/python-config
10、ln -s /usr/local/bin/python /usr/bin/python
11、ln -s /usr/local/bin/python-config /usr/bin/python-config
12、ln -s /usr/local/include/python2.7/ /usr/include/python2.7
13、easy_install pip
14、vim /usr/bin/pip
将原文件修改成如下
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: ‘pip==7.1.0’,’console_scripts’,’pip’
requires = ‘pip==10.0.1’
import sys
from pkg_resources import load_entry_point

if name == ‘main‘:
sys.exit(
load_entry_point(‘pip==10.0.1’, ‘console_scripts’, ‘pip’)()
)
注意:10.0.1为升级后的pip版本
15、pip install flask
16、pip install flask_bootstrap
17、pip install flask_moment
18、pip install flask_script
19、pip install flask_wtf
20、pip install flask_sqlalchemy
21、pip install mysql-python
22、pip install pymysql

你可能感兴趣的:(open-falcon)