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

NoReverseMatch error when using overwritten admin page #86

Open
felixsc1 opened this issue Apr 18, 2023 · 1 comment
Open

NoReverseMatch error when using overwritten admin page #86

felixsc1 opened this issue Apr 18, 2023 · 1 comment

Comments

@felixsc1
Copy link

felixsc1 commented Apr 18, 2023

In my Django project, I have overwritten the default admin site, and this breaks the django-admin-index

NoReverseMatch at /admin/mymodel/
Reverse for 'app_list' with keyword arguments '{'app_label': 'admin_index'}' not found. 1 pattern(s) tried: ['admin/(?P<app_label>mymodel)/$']

...
Error during template rendering
In template /home/felix/GitRepos/showcase/venv/lib/python3.10/site-packages/django_admin_index/templates/django_admin_index/includes/app_list.html, error at line 3

Reverse for 'app_list' with keyword arguments '{'app_label': 'admin_index'}' not found. 1 pattern(s) tried: ['admin/(?P<app_label>mymodel)/$']
1	{% load i18n django_admin_index static %}
2	
3	{% dashboard_app_list as dashboard_app_list %}
4	{% display_dropdown_menu request as should_display_dropdown %}
5	
6	{% if dashboard_app_list and should_display_dropdown %}
7	    <div class="djai-dropdown-menu">
8	        {% url 'admin:index' as home %}
9	        <a href="{{ home }}"
10	           class="djai-dropdown-menu__item {% if request.path == home %}djai-dropdown-menu__item--active{% endif %}">
11	            {% trans "Dashboard" %}
12	        </a>
13	        {% for app in dashboard_app_list %}
@sergei-maertens
Copy link
Member

I'm curious how that works with regular Django then? As far as I can see, Django's own templates also use this explicit namespace, looking at django/contrib/admin/templates/admin/change_form.html for example:

{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants