summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/views/debug.py2
-rw-r--r--tests/view_tests/tests/test_debug.py9
2 files changed, 10 insertions, 1 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index 38f1338461..10b4d22030 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -620,7 +620,7 @@ def technical_404_response(request, exception):
else:
resolved = False
if not tried or ( # empty URLconf
- request.path == "/"
+ request.path_info == "/"
and len(tried) == 1
and len(tried[0]) == 1 # default URLconf
and getattr(tried[0][0], "app_name", "")
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py
index 4b0a7cf49d..c65514a170 100644
--- a/tests/view_tests/tests/test_debug.py
+++ b/tests/view_tests/tests/test_debug.py
@@ -398,6 +398,15 @@ class DebugViewTests(SimpleTestCase):
response, "<h1>The install worked successfully! Congratulations!</h1>"
)
+ @override_settings(
+ ROOT_URLCONF="view_tests.default_urls", FORCE_SCRIPT_NAME="/FORCED_PREFIX"
+ )
+ def test_default_urlconf_script_name(self):
+ response = self.client.request(**{"path": "/FORCED_PREFIX/"})
+ self.assertContains(
+ response, "<h1>The install worked successfully! Congratulations!</h1>"
+ )
+
@override_settings(ROOT_URLCONF="view_tests.regression_21530_urls")
def test_regression_21530(self):
"""