﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36861	technical_404.html crashes on urlpatterns with include()	Christian Bahls		"= technical_404.html crashes on urlpatterns with include() =

== Summary ==

The debug 404 page (`technical_404.html`) crashes with an `AttributeError` when `urlpatterns` contains `URLResolver` objects created via `include()`.

== Description ==

The template iterates over URL patterns and accesses `.name`:

{{{#!django
{% if forloop.last and pat.name %}[name='{{ pat.name }}']{% endif %}
}}}

This fails because `.name` only exists on `URLPattern`, not `URLResolver`. The `{% if %}` guard does not prevent the crash because Django's template engine evaluates `pat.name` before checking the conditional.

== Exception ==

{{{
AttributeError: 'URLResolver' object has no attribute 'name'
}}}

== Reproduce ==

1. Configure urlpatterns with `include()` without namespace:
{{{#!python
urlpatterns = [
    path(""app/"", include(""myapp.urls"")),
]
}}}
2. Set `DEBUG=True`
3. Request any non-existent URL
4. Debug 404 page crashes instead of rendering

== Fix ==

PR: https://github.com/django/django/pull/20533"	Bug	closed	Error reporting	6.0	Normal	duplicate		Christian Bahls	Unreviewed	0	0	0	0	0	0
