﻿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
34390	NoReverseMatch at /admin/logout/	Robert Palmer	nobody	"New project running Django 4.1.7 and when I click logout from the admin interface I get NoReverseMatch error.

The admin path is being added to the root urls file like this:

{{{
from django.contrib import admin

urlpatterns = [
...
path('admin/', admin.site.urls),
...
]
}}}


It looks like all of the other route paths are using a wrap() function except for the login path. (https://github.com/django/django/blob/main/django/contrib/admin/sites.py#L268)

Full error:


{{{
NoReverseMatch at /admin/logout/
Reverse for 'login' not found. 'login' is not a valid view function or pattern name.
Request Method:	POST
Request URL:	http://localhost:8000/admin/logout/
Django Version:	4.1.7
Exception Type:	NoReverseMatch
Exception Value:	
Reverse for 'login' not found. 'login' is not a valid view function or pattern name.
Exception Location:	/code/lib/python3.11/site-packages/django/urls/resolvers.py, line 828, in _reverse_with_prefix
Raised during:	django.contrib.admin.sites.logout
Python Version:	3.11.2
Server time:	Tue, 07 Mar 2023 17:42:54 +0000
}}}
"	Bug	closed	contrib.admin	4.1	Normal	invalid			Unreviewed	0	0	0	0	1	0
