from pyramid.view import notfound_view_config @notfound_view_config(renderer='ordr:templates/errors/404.jinja2') def notfound_view(context, request): request.response.status = 404 return {}