MCPcopy
hub / github.com/django/django / catch_all_view

Method catch_all_view

django/contrib/admin/sites.py:455–467  ·  view source on GitHub ↗
(self, request, url)

Source from the content-addressed store, hash-verified

453
454 @no_append_slash
455 def catch_all_view(self, request, url):
456 if settings.APPEND_SLASH and not url.endswith("/"):
457 urlconf = getattr(request, "urlconf", None)
458 try:
459 match = resolve("%s/" % request.path_info, urlconf)
460 except Resolver404:
461 pass
462 else:
463 if getattr(match.func, "should_append_slash", True):
464 return HttpResponsePermanentRedirect(
465 request.get_full_path(force_append_slash=True)
466 )
467 raise Http404
468
469 def _build_app_dict(self, request, label=None):
470 """

Callers

nothing calls this directly

Calls 3

resolveFunction · 0.90
get_full_pathMethod · 0.80

Tested by

no test coverage detected