Skip to content

Commit

Permalink
display 404 with all tried url patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
digi604 committed Feb 27, 2014
1 parent 5b5c36d commit a770125
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cms/views.py
Expand Up @@ -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):
Expand Down

0 comments on commit a770125

Please sign in to comment.