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

Multiple Admin Error #394

Closed
edmundrotimi opened this issue May 18, 2024 · 7 comments
Closed

Multiple Admin Error #394

edmundrotimi opened this issue May 18, 2024 · 7 comments

Comments

@edmundrotimi
Copy link

edmundrotimi commented May 18, 2024

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),
  ]
@lukasvinclav
Copy link
Contributor

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

@edmundrotimi
Copy link
Author

edmundrotimi commented May 18, 2024

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

@lukasvinclav
Copy link
Contributor

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.

@edmundrotimi
Copy link
Author

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

@edmundrotimi
Copy link
Author

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

@lukasvinclav
Copy link
Contributor

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.

@edmundrotimi
Copy link
Author

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

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