《Flask web development》 3.3自定义错误页面
@app.errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
使用errorhandler装饰器,其中page_not_found(e)是继承与e的子类么?这个e代表的是什么意思?
从定义来看,e是page_not_found的参数,e可能是Exception的实例, 可以用
type(e)来鉴别。
你试试不写e不就知道了吗,基础不扎实啊。。。