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)
评论列表
文章目录