CentOS 7.2
python2.7.12
flask0.12
http://flask.pocoo.org
一.创建vitualenv并安装flask
virtualenv flask
source flask/bin/activate
pip install flask
二.创建project目录
#!/usr/bin/env
python
# -*-
coding: utf-8 -*-
from
flask
import
Flask
app
=
Flask(__name__)
@app.route('/')
def
index():
if
__name__
==
'__main__':
#!/usr/bin/env
python
# -*-
coding: UTF-8 -*-
from
flask
import
Flask
from
flask
import
render_template
app
=
Flask(__name__)
@app.route('/')
def
index():
@app.route('/bootstrap')
def
bootstrap():
if
__name__
==
'__main__':
AmazeUI
http://amazeui.org/
中国首个开源 HTML5 跨屏前端框架
本示例仅基于flask路由做了简单render_template渲染,装13时能最快的看到效果。当然,要真正做出个有意义的项目还得花大力气二次开发。
这里只是演示下flask的简单效果。yunshipei官网示例demo
https://github.com/liujun1990/templates/tree/master/flask_demo/yunshipei_based_AmazeUI