from flask import Flask,Blueprint
from blueprints.users import user_dp
from blueprints.news import news_pb
app = Flask(__name__)
app.register_blueprint(user_dp)
app.register_blueprint(news_pb)
app.debug = True
#用户模块
#电影模块
#新闻模块
#读书模块
@app.route('/')
def index():
return 'index'
if __name__ == '__main__':
app.run()
from flask import Blueprint
news_pb = Blueprint('news',__name__,url_prefix='/news')
@news_pb.route('/list/')
def news_list():
return '新闻页面'
@news_pb.route('/detail/')
def news_list():
return '新闻详情'
from flask import Blueprint
user_dp = Blueprint('user',__name__,url_prefix='/user')
@user_dp.route('/profile/')
def profile():
return '个人中心'
@user_dp.route('/setting/')
def setting():
return '个人设置'