摘要: 1 class Role(UserMixin, db.Model): 2 __tablename__ = 'Role' 3 id = db.Column(db.Integer, primary_key=True) 4 username = db.Column(db.String(64), nullable=True) 5 role = db.Column... 阅读全文
posted @ 2017-09-25 23:26 Mirgo 阅读(346) 评论(0) 推荐(0) 编辑
摘要: @app.route('/edit/', methods=['GET', 'POST']) @login_required def edit(id): content = Article.query.filter_by(id=id).first() form = postForm(title=content.title, body=content.body) ... 阅读全文
posted @ 2017-09-25 23:09 Mirgo 阅读(1443) 评论(0) 推荐(0) 编辑
摘要: # coding:utf8 from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) #app.config.from_pyfile('config') db = SQLAlchemy(app) app.config['SECRET_KEY'] = 'what s the s' ... 阅读全文
posted @ 2017-09-25 23:05 Mirgo 阅读(1293) 评论(0) 推荐(0) 编辑