﻿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
33971	admindocs breaks the admin if it appears before the admin in INSTALLED_APPS	Tom Carrick	nobody	"This seems to be different from https://code.djangoproject.com/ticket/32150 as it's about the ordering of installed apps, not urls.
https://code.djangoproject.com/ticket/33955 could be related?

It also seems to be a regression: this works fine in 4.0 but not in 4.1 / main.

This does not work, but if you reverse the order it works fine:

{{{
#!python
INSTALLED_APPS = [
    ...
    ""django.contrib.admindocs"",
    ""django.contrib.admin"",
]
}}}

With the error:

{{{
Environment:


Request Method: GET
Request URL: http://localhost:8000/admin/

Django Version: 4.2.dev20220901073912
Python Version: 3.10.0
Installed Applications:
['django.contrib.admindocs',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback (most recent call last):
  File ""/Users/tom/work/oss/django/django/core/handlers/exception.py"", line 55, in inner
    response = get_response(request)
  File ""/Users/tom/work/oss/django/django/core/handlers/base.py"", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File ""/Users/tom/work/oss/django/django/contrib/admin/sites.py"", line 261, in wrapper
    return self.admin_view(view, cacheable)(*args, **kwargs)
  File ""/Users/tom/work/oss/django/django/utils/decorators.py"", line 133, in _wrapper_view
    response = view_func(request, *args, **kwargs)
  File ""/Users/tom/work/oss/django/django/views/decorators/cache.py"", line 62, in _wrapper_view_func
    response = view_func(request, *args, **kwargs)
  File ""/Users/tom/work/oss/django/django/contrib/admin/sites.py"", line 242, in inner
    return view(request, *args, **kwargs)
  File ""/Users/tom/work/oss/django/django/contrib/admin/sites.py"", line 552, in index
    app_list = self.get_app_list(request)
  File ""/Users/tom/work/oss/django/django/contrib/admin/sites.py"", line 536, in get_app_list
    app_dict = self._build_app_dict(request, app_label)
  File ""/Users/tom/work/oss/django/django/contrib/admin/sites.py"", line 520, in _build_app_dict
    ""app_url"": reverse(
  File ""/Users/tom/work/oss/django/django/urls/base.py"", line 88, in reverse
    return resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
  File ""/Users/tom/work/oss/django/django/urls/resolvers.py"", line 803, in _reverse_with_prefix
    raise NoReverseMatch(msg)

Exception Type: NoReverseMatch at /admin/
Exception Value: Reverse for 'app_list' not found. 'app_list' is not a valid view function or pattern name.
}}}"	Bug	new	contrib.admindocs	dev	Normal				Unreviewed	0	0	0	0	0	0
