2014年9月18日 星期四

Install Flask on CentOS 7.0

1. Install pip on CentOS 7.0

## First install the EPEL repo as per your Operating system version and architecture.
rpm -ivh http://mirror01.idc.hinet.net/EPEL/7/x86_64/e/epel-release-7-1.noarch.rpm
yum install -y python-pip

2. Install Flask

pip install Flask

## Test
vi hello.py

from flask import Flaskapp = Flask(__name__)
@app.route("/")def hello():    return "Hello World!"
if __name__ == "__main__":    app.run()

## Verify
python hello.py

* Running on http://0.0.0.0:80/