标签:
1、cd 到 microblog 下
mkdir app
mkdir tmp
/app/ mkdir static
/app/ mkdir templates
2、app/__init__.py
from flask import Flask app = Flask(__name__) from app import views
3、app/views.py
from app import app @app.route(‘/‘) @app.route(‘/index‘) def index(): return "Hello, World!"
4、microblog(根目录)
#!flask/bin/python from app import app app.run(debug = True)
5、激活虚拟环境,开启服务
cd 到 microblog 输入 activate
输入 python run.py
标签:
原文地址:http://www.cnblogs.com/xiaoyutongxue/p/4356779.html