1

使用的ubuntu 15.04
Python 2.7(默认已安装)

先安装mysql
sudo apt-get install mysql-server

安装MySQLdb的模块
sudo apt-get install python-mysqldb

安装Flask
sudo easy_install Flask

编写测试:

#-*- coding:utf-8 -*-

From flask import Flask
webapp = Flask(__name__)
@webapp.route('/')
def hello_world():
    return "Hello World!"
if __name__ == '__main__':
    webapp.run(host='0.0.0.0')

bertonzou
3 声望0 粉丝