| 1 | | This seems to be different from https://code.djangoproject.com/ticket/32150 as it's about the ordering of installed apps, not urls. |
| 2 | | https://code.djangoproject.com/ticket/33955 could be related? |
| 3 | | |
| 4 | | It also seems to be a regression: this works fine in 4.0 but not in 4.1 / main. |
| 5 | | |
| 6 | | This does not work, but if you reverse the order it works fine: |
| 7 | | |
| 8 | | {{{ |
| 9 | | #!python |
| 10 | | INSTALLED_APPS = [ |
| 11 | | ... |
| 12 | | "django.contrib.admindocs", |
| 13 | | "django.contrib.admin", |
| 14 | | ] |
| 15 | | }}} |
| 16 | | |
| 17 | | With the error: |
| 18 | | |
| 19 | | {{{ |
| 20 | | Environment: |
| 21 | | |
| 22 | | |
| 23 | | Request Method: GET |
| 24 | | Request URL: http://localhost:8000/admin/ |
| 25 | | |
| 26 | | Django Version: 4.2.dev20220901073912 |
| 27 | | Python Version: 3.10.0 |
| 28 | | Installed Applications: |
| 29 | | ['django.contrib.admindocs', |
| 30 | | 'django.contrib.admin', |
| 31 | | 'django.contrib.auth', |
| 32 | | 'django.contrib.contenttypes', |
| 33 | | 'django.contrib.sessions', |
| 34 | | 'django.contrib.messages', |
| 35 | | 'django.contrib.staticfiles'] |
| 36 | | Installed Middleware: |
| 37 | | ['django.middleware.security.SecurityMiddleware', |
| 38 | | 'django.contrib.sessions.middleware.SessionMiddleware', |
| 39 | | 'django.middleware.common.CommonMiddleware', |
| 40 | | 'django.middleware.csrf.CsrfViewMiddleware', |
| 41 | | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 42 | | 'django.contrib.messages.middleware.MessageMiddleware', |
| 43 | | 'django.middleware.clickjacking.XFrameOptionsMiddleware'] |
| 44 | | |
| 45 | | |
| 46 | | |
| 47 | | Traceback (most recent call last): |
| 48 | | File "/Users/tom/work/oss/django/django/core/handlers/exception.py", line 55, in inner |
| 49 | | response = get_response(request) |
| 50 | | File "/Users/tom/work/oss/django/django/core/handlers/base.py", line 197, in _get_response |
| 51 | | response = wrapped_callback(request, *callback_args, **callback_kwargs) |
| 52 | | File "/Users/tom/work/oss/django/django/contrib/admin/sites.py", line 261, in wrapper |
| 53 | | return self.admin_view(view, cacheable)(*args, **kwargs) |
| 54 | | File "/Users/tom/work/oss/django/django/utils/decorators.py", line 133, in _wrapper_view |
| 55 | | response = view_func(request, *args, **kwargs) |
| 56 | | File "/Users/tom/work/oss/django/django/views/decorators/cache.py", line 62, in _wrapper_view_func |
| 57 | | response = view_func(request, *args, **kwargs) |
| 58 | | File "/Users/tom/work/oss/django/django/contrib/admin/sites.py", line 242, in inner |
| 59 | | return view(request, *args, **kwargs) |
| 60 | | File "/Users/tom/work/oss/django/django/contrib/admin/sites.py", line 552, in index |
| 61 | | app_list = self.get_app_list(request) |
| 62 | | File "/Users/tom/work/oss/django/django/contrib/admin/sites.py", line 536, in get_app_list |
| 63 | | app_dict = self._build_app_dict(request, app_label) |
| 64 | | File "/Users/tom/work/oss/django/django/contrib/admin/sites.py", line 520, in _build_app_dict |
| 65 | | "app_url": reverse( |
| 66 | | File "/Users/tom/work/oss/django/django/urls/base.py", line 88, in reverse |
| 67 | | return resolver._reverse_with_prefix(view, prefix, *args, **kwargs) |
| 68 | | File "/Users/tom/work/oss/django/django/urls/resolvers.py", line 803, in _reverse_with_prefix |
| 69 | | raise NoReverseMatch(msg) |
| 70 | | |
| 71 | | Exception Type: NoReverseMatch at /admin/ |
| 72 | | Exception Value: Reverse for 'app_list' not found. 'app_list' is not a valid view function or pattern name. |
| 73 | | }}} |