#34390: NoReverseMatch at /admin/logout/
-----------------------------------------+------------------------
Reporter: Robert Palmer | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+------------------------
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
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34390>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070186bd30eac9-201dac03-5928-47f5-8481-bb89893fd628-000000%40eu-central-1.amazonses.com.