Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upon installation admin interface error: Reverse for 'app_list' not found. 'app_list' is not a valid view function or pattern name. #27

Closed
dirkjankrijnders opened this issue Jan 13, 2020 · 4 comments
Labels
Milestone

Comments

@dirkjankrijnders
Copy link

Hi,

I just installed django-data-wizard to try it out according to the README.md. However as soon as I add data_wizard to my INSTALLED_APPS I get the error below when trying to access /admin. This is running the latest version from git, but I also tried the pypi version and I tried django 2.2.6. All with the same result?
Did I miss something? Where do I start looking?
Thanks,

Dirkjan

Environment:


Request Method: GET
Request URL: http://localhost:8000/admin/

Django Version: 3.0.2
Python Version: 3.7.3
Installed Applications:
['catalogitem.apps.CatalogitemConfig',
 'viewer.apps.ViewerConfig',
 'import_export',
 'data_wizard',
 'data_wizard.sources',
 'markdown_deux',
 'crispy_forms',
 'pagedown',
 'leaflet',
 'rest_framework',
 'location_field.apps.DefaultConfig',
 'django_filters',
 '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 "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/contrib/admin/sites.py", line 249, in wrapper
    return self.admin_view(view, cacheable)(*args, **kwargs)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/contrib/admin/sites.py", line 231, in inner
    return view(request, *args, **kwargs)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/contrib/admin/sites.py", line 499, in index
    app_list = self.get_app_list(request)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/contrib/admin/sites.py", line 482, in get_app_list
    app_dict = self._build_app_dict(request)
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/contrib/admin/sites.py", line 467, in _build_app_dict
    current_app=self.name,
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/urls/base.py", line 87, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
  File "/home/dirkjan/Projects/rostma-docker/rostma/venv/lib/python3.7/site-packages/django/urls/resolvers.py", line 677, 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.
@sheppard
Copy link
Member

sheppard commented Feb 4, 2020

At first glance, it's not clear that this is a bug with data wizard. Is admin.site.urls included in your urls.py?

@sheppard
Copy link
Member

sheppard commented Feb 4, 2020

Hmm, it looks like this can happen if "data_wizard" is listed before "django.contrib.admin" in INSTALLED_APPS.

@sheppard
Copy link
Member

sheppard commented Feb 4, 2020

Ok, there was a urlconf check in data_wizard.apps.WizardConfig that was interfering with the admin (but only if data_wizard was listed first). The check is not really needed anymore so I removed it and the order now does not matter.

@sheppard sheppard added bug and removed question labels Feb 4, 2020
@dirkjankrijnders
Copy link
Author

That fixed it indeed. I just tested with the latest code from git and the installation was flawless. Thanks for looking into it.

@sheppard sheppard added this to the 1.3 milestone Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants