#33971: admindocs breaks the admin if it appears before the admin in 
INSTALLED_APPS
-------------------------------------+-------------------------------------
     Reporter:  Tom Carrick          |                    Owner:  Mariusz
                                     |  Felisiak
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.admindocs    |                  Version:  4.1
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Old description:

> 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.
> }}}

New description:



--

Comment (by Maxim Danilov):

 This patch war unnecessary.
 with the same Effect we can remove method ready from class
 AdminDocsConfig(AppConfig) from django.contrib.admindocs.apps

 For topik starter:
 I use many times admindocs in my projects and it was easy solution: to
 redefine AdminDocsConfig with empty ready method.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33971#comment:7>
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/01070183129dc166-74578490-4381-497c-9375-be561862761a-000000%40eu-central-1.amazonses.com.

Reply via email to