摘要:
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... 阅读全文
摘要:
@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) ... 阅读全文
摘要:
# 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' ... 阅读全文