使用 pyramid_handlers 更改 HTTPNotFound 渲染器
Change HTTPNotFound renderer using pyramid_handlers
我想标题不言而喻。
我一直在寻找如何更改在我的服务器上发生 404 时显示的页面。到目前为止,我所看到的只是按照文档所述使用 Hooks 对其进行修改。
原来我用的是pyramid_handlers,不知道怎么改。
有人愿意帮忙吗?
from pyramid.view import notfound_view_config
@notfound_view_config(renderer='404.html')
def not_found(request):
return {}
我想标题不言而喻。
我一直在寻找如何更改在我的服务器上发生 404 时显示的页面。到目前为止,我所看到的只是按照文档所述使用 Hooks 对其进行修改。
原来我用的是pyramid_handlers,不知道怎么改。 有人愿意帮忙吗?
from pyramid.view import notfound_view_config
@notfound_view_config(renderer='404.html')
def not_found(request):
return {}