金字塔。更改url_scheme https的“找不到”视图

2024-10-03 04:35:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用金字塔框架,我的网站工作在https模式。在

我改变了未找到的视图-它工作正常,用户看到我的“完美”404页面。在

但是当用户加载http://example.com页(不是https)时,用户看到404默认页(不是myfine_404)。在

如果我的网站在https模式下工作,如何更改http方案的未找到视图?在

一些代码:

在中更改未找到的视图视图.py公司名称:

@notfound_view_config(renderer='mysite:templates/my_fine_404.pt')
def not_found(request):
    request.response.status = 404
    return {'content': u'Sorry, page not found.'}

https的*.ini中的设置:

^{pr2}$

Tags: 用户httpscom框架视图http网站example