Skip to content

Commit

Permalink
Merge pull request django-cms#2755 from digi604/fix-404
Browse files Browse the repository at this point in the history
display 404 with all tried url patterns
  • Loading branch information
digi604 committed Feb 28, 2014
2 parents 8bc14f4 + 88cd203 commit ab928a7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cms/views.py
Original file line number Diff line number Diff line change
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:
#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)


def details(request, slug):
Expand Down

0 comments on commit ab928a7

Please sign in to comment.