2018-05-29 Allowed methods have
2018-05-29 本文已影响0人
lucasdada
Flask
from flask import (
Blueprint,flash,g,redirect,render_template,request,url_for
)
from werkzeug.exceptions import abort
from flaskr.auth import login_required
from flaskr.db import get_db
bp = Blueprint('blog',__name__)
@bp.route('/<int:id>/delete',methods=('POST',))
@login_required
def delete(id):
pass
如果上面的methods只写了methods=('POST')
就会爆出如上错误,记得加上逗号,让传进去的参数是可迭代的。