-
Notifications
You must be signed in to change notification settings - Fork 709
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
Comments
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) |
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 |
You can both try latest develop branch - this commit should choose right apps for menu. |
If anybody cares: here is a monkey patch to support custom SUIT_CONFIGs per AdminSite: |
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 ?
The text was updated successfully, but these errors were encountered: