运行程序时,报错:TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.
结果仔细排查下发现,原来是由于代码中(if request.method == ‘GET’:)少写了method
# 请求request
@blue.route('/my_index/', methods=['GET', 'POST', 'PUT'])
def my_index():
if request.method == 'GET':
return render_template('index.html')
if request.method == 'POST':
pass