unfoldadmin / django-unfold

Modern Django admin theme for seamless interface development

Home Page:https://unfoldadmin.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple Admin Error

edmundrotimi opened this issue · comments

I encountered a 'Reverse for 'toggle_sidebar' not found. 'toggle_sidebar' is not a valid view function or pattern name.' after creating multiple admins.

  from django.contrib.admin import AdminSite
  
  class StaffAdminSite(AdminSite):
      site_header = 'admin'
  
  staffadmin = StaffAdminSite(name='staffadmin')


  urlpatterns = [
      path('admin/', admin.site.urls),
      path('staff/', staffadmin.urls),
  ]

Do you have unfold.apps.BasicAppConfig in installed apps?

@lukasvinclav thanks for the reply. Adding unfold.apps.BasicAppConfig in installed apps gives an error: 'ImportError: Module 'unfold.apps' does not contain a 'BasicAppConfig' class. Choices are: 'DefaultAppConfig'. I tried with DefaultAppConfig but got an error.

Which version of Unfold are you using? If you are on the most recent version and still having the issue please create a repo where it is possible to reproduce the issue.

@lukasvinclav I upgraded from 0.22 to 0.23. Adding unfold.apps.BasicAppConfig gives Application labels aren't unique, duplicates: unfold.

@lukasvinclav thanks again for the response. I have replicated it here: https://github.com/edmundrotimi/replica. The error should show when you login via the staff.

Here is the guide how to integrate this feature: https://unfoldadmin.com/blog/migrating-django-admin-unfold/

I noticed, that you have wrong first line in INSTALLED_APPS. It has to be unfold.apps.BasicAppConfig, not only unfold. Everything is explained in article.

@lukasvinclav Thanks for the response and help. The error has been fixed.