2018-05-29 Allowed methods have to be iterables of strings, for example: @app.route(..., methods=...

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('//delete',methods=('POST',))
@login_required
def delete(id):
  pass

如果上面的methods只写了methods=('POST')
就会爆出如上错误,记得加上逗号,让传进去的参数是可迭代的。

你可能感兴趣的:(2018-05-29 Allowed methods have to be iterables of strings, for example: @app.route(..., methods=...)