[Django] #34390: NoReverseMatch at /admin/logout/

99 views
Skip to first unread message

Django

unread,
Mar 7, 2023, 12:49:08 PM3/7/23
to django-...@googlegroups.com
#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.

Django

unread,
Mar 7, 2023, 1:21:50 PM3/7/23
to django-...@googlegroups.com
#34390: NoReverseMatch at /admin/logout/
-------------------------------+--------------------------------------

Reporter: Robert Palmer | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* 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>

Reply all
Reply to author
Forward
0 new messages