Open Ru7z opened 6 years ago
Look in settings\apps.py
.
My file looks something like:
# -*- coding: utf-8 -*-
"""
Django Suit Configuration Module
"""
from django.apps import AppConfig
from django import get_version
from suit.apps import DjangoSuitConfig
from suit.menu import ParentItem, ChildItem
class SuitConfig(DjangoSuitConfig):
layout = 'horizontal' # or 'vertical'
name = 'suit'
django_version = get_version()
menu = (
ParentItem('Client', children=[
ChildItem(model='myapp.model1'),
ChildItem(model='myapp.model2),
], icon='fa fa-example-o'),
...
@gamesbook i cant get custom menu in admin, instead i am still getting all available apps models.
i have two django apps, i have code that you adviced in one of them, and i want to use it as default menu in admin site.
i think that menu is generated in templatetags/suit_menu.py
get_menu
function, which takes context.available_apps
and passes it into MenuManager(available_apps, context, request)
.
in MenuManager.__init__
is call self.current_app = get_current_app(request)
which always return admin
so i cant see how to use menu definition from my own app.
can you please advice me what i am doing wrong?
using django 2.2
@tyctor I am not using the method you describe so I am not sure how to help.
ok, thanks for answer @gamesbook could you please describe your configuration how you using suit custom menu?
My example is shown above.
ok, so this is only code what you need to get custom menu work in django admin?
cant believe this, because that was first thing what i tryied: traverse through demo code, and try code from demo/apps.py
i have suit v2 theme, but not custom menu, so i think something is missing, and cant figure out what it is
ok, i figured out where was problem, i mixed configs for django app and django suit, now it is working
How can i config
SUIT_CONFIG
(settings.py
in v1) in v2?BTW, can i remove my actions and Authentication and Authorization in admin page?