inception_web

1) wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py

2) python ez_setup.py --insecure

3)  wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9

4) tar zxvf pip-9.0.1 && cd pip-9.0.1

5) python setup.py install

6) pip install flask_wtf

    pip install flask-script

    pip install flask-debugtoolbar

    pip install MySQL-python

6)启动inception_web
/home/source/inception_web/run.py runserver --host 0.0.0.0

 这个时候,从web里输入中文,会出现异常,解决方法

vi /usr/lib64/python2.6/site-packages/MySQLdb/cursors.py


原来的execute是这样定义的:
    def execute(self, query, args=None): 
修改之后为
    def execute(self, query, char="utf-8", args=None): 
然后将
        charset = db.character_set_name() 
        query = query.encode(charset) 
改为
        charset = char 
        query = query.encode(charset) 

 

posted @ 2017-07-10 10:31  taek  阅读(202)  评论(0编辑  收藏  举报