Skip to content
Browse files

display 404 with all tried url patterns

  • Loading branch information...
1 parent 5b5c36d commit a7701252dc1192d31e24f14669ac3a5f31b75b8e @digi604 digi604 committed Feb 27, 2014
Showing with 10 additions and 1 deletion.
  1. +10 −1 cms/views.py
View
11 cms/views.py
@@ -20,14 +20,23 @@
from django.template.context import RequestContext
from django.utils.http import urlquote
from django.utils.timezone import get_current_timezone_name
+from django.utils.translation import get_language
CMS_PAGE_CACHE_VERSION_KEY = 'CMS_PAGE_CACHE_VERSION'
+
def _handle_no_page(request, slug):
if not slug and settings.DEBUG:
return TemplateResponse(request, "cms/welcome.html", RequestContext(request))
- raise Http404('CMS: Page not found for "%s"' % slug)
+ try:
+ if settings.USE_I18N:
+ resolve('/%s//' % get_language())
+ else:
+ resolve('//')
+ except Resolver404, e:
+ exc = Http404(dict(path=request.path, tried=e.args[0]['tried']))
+ raise exc
def details(request, slug):

0 comments on commit a770125

Please sign in to comment.
Something went wrong with that request. Please try again.