为什么烧瓶重定向给我空白页?

时间:2020-06-22 10:19:21

标签: python python-3.x flask

这是我的重定向路线:

from flask import Api, Resource
from flask import Blueprint, redirect

users_blueprint = Blueprint('users', __name__, template_folder='')
api = Api(users_blueprint)

@users_blueprint.route('/signout')
def signout():
    if not session['user_id']:
        return redirect('/')
    del session['user_id']
    return redirect('/')


class LandingPage(Resource):

    def get(self):
        return render_template('index.html')


api.add_resource(LandingPage, '/')

我没有任何错误。 '/'路由可以很好地呈现,但是我无法从signout()函数重定向到该路由。它只是给我空白页。

0 个答案:

没有答案