
解决方法如下
到你报错为xxxxx的重定向redirect下,更改为自定的Blueprint.函数名 例如
报错为werkzeug.routing.BuildError: Could not build url for endpoint
‘testfunc’. Did you mean ‘testblue.testfunc’ instead?
testblue = Blueprint( # 自定蓝图
"testblue",
__name__,
static_folder=os.path.join(root,'static'),
template_folder=os.path.join(root,'templates')
)
以下会报错
@testblue.rout('/')
def helloword():
return redirect('testfunc') #这里报的错
@testblue.rout('/test/')
def testfunc():
return render_template("index.html")
改为
@testblue.rout('/')
def helloword():
return redirect('testblue.testfunc') #这里做了更改
@testblue.rout('/test/')
def testfunc():
return render_template("index.html")
即可
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)