page_rendering.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:DjangoCMS 作者: farhan711 项目源码 文件源码
def _handle_no_page(request, slug):
    context = {}
    context['cms_version'] = __version__
    context['cms_edit_on'] = get_cms_setting('CMS_TOOLBAR_URL__EDIT_ON')

    if not slug and settings.DEBUG:
        return TemplateResponse(request, "cms/welcome.html", context)
    try:
        #add a $ to the end of the url (does not match on the cms anymore)
        resolve('%s$' % request.path)
    except Resolver404 as e:
        # raise a django http 404 page
        exc = Http404(dict(path=request.path, tried=e.args[0]['tried']))
        raise exc
    raise Http404('CMS Page not found: %s' % request.path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号