This is sample SuitConfig
in django suit 2.0 demo app.
You can see demo app here
And the menu settings is right below. Just use ParentItem
and ChildItem
.
PLEASE CHECK that your app name is lowercase : (demo.country
, not demo.Country
). I spended hour to find this wrong. If something’s wrong in this SuitConfig, it never shows error. So please check your spell well.
from suit.apps import DjangoSuitConfig
from suit.menu import ParentItem, ChildItem
class SuitConfig(DjangoSuitConfig):
menu = (
ParentItem('Content', children=[
ChildItem(model='demo.country'),
ChildItem(model='demo.continent'),
ChildItem(model='demo.showcase'),
ChildItem('Custom view', url='/admin/custom/'),
], icon='fa fa-leaf'),
ParentItem('Integrations', children=[
ChildItem(model='demo.city'),
]),
ParentItem('Users', children=[
ChildItem(model='auth.user'),
ChildItem('User groups', 'auth.group'),
], icon='fa fa-users'),
ParentItem('Right Side Menu', children=[
ChildItem('Password change', url='admin:password_change'),
ChildItem('Open Google', url='http://google.com', target_blank=True),
], align_right=True, icon='fa fa-cog'),
)
'backend > django' 카테고리의 다른 글
django: using queryset chainable model manager (0) | 2018.02.17 |
---|---|
django: postgres full text search mixin (0) | 2018.02.16 |
django suit v.2.0 change site_header (0) | 2018.02.13 |
django suit v.2.0 후기 및 팁 (0) | 2018.02.12 |
Django: DetailView, UpdateView pk나 slug 없이 사용하기 (0) | 2018.02.06 |