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

Support for Multiple AdminSites. #105

Open
nchampsavoir opened this issue May 20, 2013 · 4 comments
Open

Support for Multiple AdminSites. #105

nchampsavoir opened this issue May 20, 2013 · 4 comments

Comments

@nchampsavoir
Copy link

Django-Suit does not support multiple AdminSites on the same Django instance. The left menu relies on admin.site to check which app/model is available, and which one is active.

It would be great to support multiple admin sites. One possible (backward compatible) solution to accept additional keys in the SUIT_CONFIG configuration item. Those keys would map AdminSite names to nested SUIT_CONFIG options that overload the default ones ?

@ScottBarkman
Copy link

I recently used suit in a multi-admin setting, and the left menu is easily changed by creating your own template tag based on the suit_menu tag (suit/templatetags/suit_menu.py) and replacing the admin.site (line 20) reference with your custom AdminSite instance... which could be derived based on the request URL that is already being passed to the get_menu template tag.

However, I do second the thought that suit should support multiple admin sites more natively. (ie: full config settings and what not)

@ebsaral
Copy link

ebsaral commented Dec 22, 2013

This is really lame. It's not that hard to connect custom AdminSite into suit. I had been looking for my mistake till I saw Scott's comment here. Waste of time. Thanks Scott.

By the way, you don't have to replace default AdminSite. You can add your AdminSite by combining your app_list with default's. For example:

import my_app

template_response = admin.site.index(request)
template_response_my_admin = my_app.admin.my_admin_instance.index(request)
    try:
        app_list = template_response.context_data['app_list'] + template_response_my_admin.context_data['app_list']
    except Exception:
        return

darklow added a commit that referenced this issue Dec 27, 2013
@darklow
Copy link
Owner

darklow commented Dec 27, 2013

You can both try latest develop branch - this commit should choose right apps for menu.
However there is currently no way to separate which Suit settings and extra menu should be applied to which admin_site, i need more time to develop that.

@titusz
Copy link

titusz commented May 16, 2014

If anybody cares: here is a monkey patch to support custom SUIT_CONFIGs per AdminSite:
https://gist.github.com/titusz/dfc20bc6fc40ff82a286

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

5 participants