You can use `@app.errorhandler(404)` here. There appears to be a Flask bug that causes Baseframe's 404 handler to override app handlers, however, so check if that works.