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
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34390>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
Thanks for the report, however the admin works for me. If you're having
trouble understanding how Django works, see
TicketClosingReasons/UseSupportChannels for ways to get help.
--
Ticket URL: <https://code.djangoproject.com/ticket/34390#comment:1>